views:

1377

answers:

3

I am learning VIM. The VIM folder in the windows has two subdirectories VIM72 and VIMFILE. What is the difference between them? Where should I install my plugins?

+7  A: 

Usually VIM72 (depends on the vim version) is the 'runtime' directory, I believe this is where vim is searching for all the stuff that it needs during 'runtime'. You would install your custom stuff, e.g. plugins, in your '$HOME/.vim' directory on linux (plugins in $HOME/.vim/plugin).

On windows it seems to be the vimfiles directory (you asked about VIMFILE on my windows system and vim71 it is vimfiles).

So I would try to store plugin in vimfiles\plugin directory on your system. The difference would be that in VIM72 you would have all the runtime stuff that comes prepackaged with vim including binaries. You can install your own stuff in your vimfiles directory which will be usually searched first for stuff like syntax highlight, color schemes, plugins, documentation and so on.

You can find out the location of your vim72 directory, the location for your custom stuff like vim72/plugins, vim72/colors for colorshemes and so on, from vim do:

:echo $VIMRUNTIME

And finally, vim72 is used by vim 7.2 so when the version changes it will use different directory like vim73 and so on.

stefanB
On Windows, you can add personal settings to $HOME/vimfiles - I can't tell if that's what you meant or if you were referring to C:\Program Files\Vim\vimfiles
jmohr
Maybe on windows you can add your personal stuff to $HOME/vimfiles but I don't have anything related to vim in that directory. I was talking about Linux related to $HOME and vimfiles are on Windows only. So I meant what I wrote. I try to avoid using full path like C:\Program Files\Vim\vimfiles because that really depends where you installed vim. I have mine somewhere else but the Vim directory has vimfiles subdirectory and vim72 subdirectory and that's what we were discussing about. You can find out the location of your vim72 directory, where you put your stuff, from vim do :echo $VIMRUNTIME
stefanB
+3  A: 

Expanding very slightly on stefan's answer:
Like he says, ~/.vim for linux-related systems, and usually vimfiles for gvim on Windows - this is your home vim directory.

You should put all of your own plugins into vimfiles to make sure that when you upgrade your vim installation you don't lose any of the custom plugins or modifications.

For example
There is a syntax file called cpp.vim in vim72/syntax.
If you now want to change a few things in this syntax file (say to add an extra keyword) you could have a copy of this syntax file in vimfiles/syntax with the additional keyword syntax rules.
Now when you upgrade vim to 7.3, you still have all of your custom plugins and settings.

If you were to instead change vim72/syntax/cpp.vim, when you next upgraded vim these files would be overwritten by the new versions and any changes that you made would be lost.
Plus, since vim72/syntax/ contains all of the original syntax files, it would be more difficult to tell which of these you had customised.

Andy
+1  A: 

That 'vimfiles' directory is where you can install things system-wide without touching Vim's installation directory ('vim72'). The directory 'vim72' is subject to change when upgrading and a new major or minor version will use a different directory (e.g. Vim 7.1 used 'vim71' and Vim 8.0 will use 'vim80').

graywh