Run Vim on Ubuntu:E117: Unknown function: pathogen#infect - vim

I have a simple .vimrc file. It is 3 lines in its entirety:
execute pathogen#infect()
syntax on
filetype plugin indent on
When I try to start vim, though, I get the following error message:
Error detected while processing /home/simoonp/.vimrc:
line 1:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
I searched many means , but the question hasn't been solved.

Related

Syntax error near unexpected token 'newline'? [duplicate]

This question already has answers here:
error while running "source .vimrc"
(2 answers)
Closed 2 years ago.
I have the following written in my .vimrc file
set number
set hlsearch
set mouse=a
map F2 :bprev CR
Getting follwoing error while sourcing .vimrc file
-bash: .vimrc: line 4: syntax error near unexpected token `newline'
-bash: .vimrc: line 4: `map <F2> :bprev <CR>'
.vimrc isn't a shell script; it's a vim script. Both programs have a set command (though each does something very different than the other), which is how you get to line 4 at all. The problem here is that the shell sees the < and > as redirection operators, and the final > is followed by a newline, not a file name; hence, the syntax error.

Added new scripts for vim functionality that is not working

I am in a Mac OS and I just added some scripts to get new functionality from my vim editor and when I go back into the vimrc file I continue to get this error:
vim ~/.vimrc
Error detected while processing /Users/danale/.vimrc:
line 12:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
I have looked at similar posts here that are not very helpful. Ultimately, I would like to use nerdtree configuration so I can use VIM as my IDE.
If I hit enter anyway, I get this error:
Error detected while processing VimEnter Auto commands for "*":
E492: Not an editor command: NERDTree | endif
and it does not take me to a nerdtree type of view just an empty welcome to vim view.
You need to install pathogen.

syntax error near unexpected token error [duplicate]

This question already has answers here:
error while running "source .vimrc"
(2 answers)
Closed 4 years ago.
Below is my .vimrc file
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tomlion/vim-solidity'
Plugin 'othreaa/yajs.vim'
call vundle#end()
filetype plugin indent on
set autoindent
set wrap
set nobackup
set ruler
syntax on
set number
set tabstop=4
colo desert
syntax on
when I type 'source .vimrc' to activate the configuration file, i got the following error message
-bash: .vimrc: line 6: syntax error near unexpected
token `('
-bash: .vimrc: line 6: `call vundle#begin()'
I cannot see what is wrong. Can I help?
Bash cannot parse that. You need to use Vim instead, to parse. Open up Vim and type :source ~/.vimrc in Normal mode.

GVIM Vundle issue on windows

I'm getting this error with Vundle begin method.
Error detected while processing function vundle#end..vundle#config#activ
ate_bundles..<SNR>4_rtp_add_a:
line 4:
E117: Unknown function: fnameescape
E15: Invalid expression: 'set rtp^='.fnameescape(prepends)
line 5:
E117: Unknown function: fnameescape
E15: Invalid expression: 'set rtp+='.fnameescape(appends)
Error detected while processing function vundle#end..vundle#config#activ
ate_bundles..<SNR>4_rtp_add_defaults:
line 7:
E117: Unknown function: fnameescape
E15: Invalid expression: fnameescape(default_rtp_items[0])
line 8:
E121: Undefined variable: first_item
E15: Invalid expression: 'set rtp-=' . first_item
line 9:
E121: Undefined variable: first_item
E15: Invalid expression: 'set rtp^=' . first_item
Error detected while processing D:\GVimPortable\Data\settings\vimrc:
line 117:
E518: Unknown option: relativenumber
line 357:
E185: Cannot find color scheme solarized
I've used Vundle with MAC before, but in windows it's not working.
Not sure it's with windows specific or not.
Please help if you have any idea about this issue.
Thanks
Your Vim doesn't have the fnameescape() function, nor 'relativenumber'. It must be a really old Vim version, like 7.0 or 7.1. You can check with :version.
To use Vundle, you need to upgrade to a newer version; i.e. 7.4 or 8.0.

Syntastic installation issue: ^M file endings

I'm trying to install Syntastic for Vim using Cygwin. After completing step 2.1 and the cloning part of step 2.2 in the installation guide of Syntastic, I find that now when I run vim I get the following errors:
Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim:
line 1:
E15: Invalid expression: exists("g:loaded_syntastic_notifier_autoloclist") || !exists("g:loaded_syntastic_plugin")^M
line 39:
E171: Missing :endif
Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/balloons.vim:
line 1:
E15: Invalid expression: exists("g:loaded_syntastic_notifier_balloons") || !exists("g:loaded_syntastic_plugin")^M
line 67:
E171: Missing :endif
Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/checker.vim:
line 1:
E15: Invalid expression: exists("g:loaded_syntastic_checker") || !exists("g:loaded_syntastic_plugin")^M
There were a few more errors, but they follow this basic format. From what I understand, file endings in the listed files are incorrect (i.e. ^M). However when I open these files in Vim, there does not seem to be any ^M endings to delete.
How do I fix this problem?
Load the file into vim, then :set fileformat=unix and :wq should fix it.
PS: you don't see the ^Ms because vim thinks it is a dos file (it probably says [dos] in the status bar after loading).
This command will transform every file to a unix file in the ~/.vim/bundle directory.
find ~/.vim/bundle -type f -follow -print|xargs dos2unix

Resources