Open Vim with the plugins disabled and type :set rtp - note that:
- if you are on Unix, then by default: the first goes
~/.vim , and the last goes ~/.vim/after ; - if you are on Windows, then by default: the first goes
~/vimfiles , and the last goes ~/vimfiles/after .
This is a kind of Vim convention. after directories are used to force the default settings of Vim or plugins to be overridden, which is sometimes important. This is why they are the latest in rtp .
Pathogen actually analyzes the structure of your current rtp variable and uses it to correctly enter plugin paths in rtp . For example, look at my rtp :
runtimepath= ~/.vim, ~\.vim\plugins\NERDCommenter, ~\.vim\plugins\NERDTree, ~\.vim\plugins\SameSyntaxMotion, ~\.vim\plugins\Tabular, ~\.vim\plugins\UltiSnips, ~\.vim\plugins\c.vim, ~\.vim\plugins\clang_complete, ~\.vim\plugins\CountJump, ~\.vim\plugins\delimitMate, ~\.vim\plugins\fswitch, ~\.vim\plugins\matchit, ~\.vim\plugins\matlab, ~\.vim\plugins\neocomplcache, ~\.vim\plugins\protodef, ~\.vim\plugins\python-syntax, ~\.vim\plugins\solarized, ~\.vim\plugins\syntastic, ~\.vim\plugins\vim-creole, ~\.vim\plugins\vim-latex, ~\.vim\plugins\vim-markdown, ~\.vim\plugins\vim-python-pep8-indent, ~/vimfiles, D:\Applications\Vim/vimfiles, D:\Applications\Vim, D:\Applications\Vim/vimfiles/after, ~/vimfiles/after, ~\.vim\plugins\Tabular\after, ~\.vim\plugins\UltiSnips\after, ~\.vim\plugins\vim-markdown\after, ~/.vim/after
Notice how pathogen introduced the paths. He found that several plugins have an after directory and place them right in front of ~/.vim/after - so the last word is always mine.
To achieve this pathogen, you need a pair of either ~/.vim , and ~/.vim/after , or ~/vimfiles and ~/vimfiles/after , or even ~/stuff and ~/stuff/after (not sure about the latter case) in as an anchor for injection plugins' paths in the correct order.
If any directory from this pair is missing, then you will have some unpleasant experience with the pathogen (as I once was until I found out all the above things and looked at the source code of the pathogen) - because the paths cannot proper injection.
Now you can see that the answer provided by Prince Goulash is completely wrong :
- the first error was that he added
~/.vim to rtp , whereas he had to add it; - The second mistake is that he did not add
~/.vim/after .
The correct solution is as follows. If you need to work on different platforms, including Windows, you should add this to your .vimrc (I also keep this in my own - you can conclude from my rtp example):
if has('win32') || has('win64') set runtimepath^=~/.vim set runtimepath+=~/.vim/after endif
This snippet will ensure consistency between platforms. Now you can use the Unix-like .vim directory even on Windows and forget about shit vimfiles , which is an IMO ugly and terrible.
After that you call:
call pathogen
NOTE. 'plugins' refers to the ~/.vim/plugins directory, therefore it refers to ~/.vim .