I make a .vim directory in my home directory. I then made an autoload directory and a bundle directory. I added the pathogen.vim file to the autoload directory. I then added execute pathogen#infect() to my vimrc but there is a point I might have gone wrong. I have 3 different vimrc files, one in /etc/vim, one in /usr/share/vim and one in my home directory. Which one should I have edited? I have tried all 3 but it still doesn't work, and I'm getting errors:

Error detected while processing /usr/share/vim/vimrc:
line 1:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
Press ENTER or type command to continue

Can anyone help?

More generally, when I want to edit my vimrc, where should I do this? in /etc/vim/vimrc? in /usr/share/vim/vimrc? in ~/vim/vimrc? or just ~/vimrc?

  • 1
    looks like pathogen is not installed. What have you done? Can you please show your directory structure? Did you follow the installation instruction? Dec 22, 2015 at 16:29
  • 2
    Use the one in your home directory. The others should NOT be touched. Dec 22, 2015 at 16:36
  • OK, but should I now restore the other ones to their default settings or leave them alone? Dec 22, 2015 at 16:44
  • 3
    You need to revert your system-wide vimrc to its pristine state.
    – romainl
    Dec 22, 2015 at 21:23
  • 1
    ~/vimrc is a typo? Should be ~/.vimrc.
    – Alex Kroll
    Dec 23, 2015 at 4:40

1 Answer 1


Solved - restore all vimrc files except for the one in ~/.vimrc to their defaults.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.