Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between vim72 and vimfiles folder?

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?

like image 858
unj2 Avatar asked May 12 '09 04:05

unj2


3 Answers

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.

like image 141
stefanB Avatar answered Oct 22 '22 07:10

stefanB


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.

like image 42
Andy Avatar answered Oct 22 '22 05:10

Andy


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').

like image 4
graywh Avatar answered Oct 22 '22 05:10

graywh