简体   繁体   English

vim72和vimfiles文件夹有什么区别?

[英]What is the difference between vim72 and vimfiles folder?

I am learning VIM. 我正在学习VIM。 The VIM folder in the windows has two subdirectories VIM72 and VIMFILE. Windows中的VIM文件夹有两个子目录VIM72和VIMFILE。 What is the difference between them? 他们之间有什么区别? Where should I install my plugins? 我应该在哪里安装我的插件?

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'. 通常VIM72 (取决于vim版本)是'运行时'目录,我相信这是vim在'运行时'期间搜索它所需的所有东西的地方。 You would install your custom stuff, eg plugins, in your ' $HOME/.vim ' directory on linux (plugins in $HOME/.vim/plugin ). 您可以在linux上的' $ HOME / .vim '目录中安装自定义内容(例如插件)( $ 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 ). 在Windows上,似乎是vimfiles目录(你问我VIMFILE Windows系统和vim71是vimfiles)。

So I would try to store plugin in vimfiles\\plugin directory on your system. 所以我会尝试将插件存储在系统上的vimfiles \\ plugin目录中。 The difference would be that in VIM72 you would have all the runtime stuff that comes prepackaged with vim including binaries. 不同之处在于,在VIM72中,您将拥有预先包装了vim的所有运行时内容,包括二进制文件。 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. 您可以在vimfiles目录中安装自己的东西,这些目录通常会首先搜索语法高亮,颜色方案,插件,文档等内容。

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: 您可以从vim do找到vim72目录的位置, vim72/plugins等自定义内容的位置, vim72/plugins vim72/colors等等:

: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. 最后, vim72由vim 7.2使用,因此当版本更改时,它将使用不同的目录,如vim73等。

Expanding very slightly on stefan's answer: 在stefan的回答中略微扩展:
Like he says, ~/.vim for linux-related systems, and usually vimfiles for gvim on Windows - this is your home vim directory. 就像他说的那样, ~/.vim用于linux相关系统,通常是用于Windows上的gvim的vimfiles - 这是你的家庭vim目录。

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. 您应该将所有自己的插件放入vimfiles中,以确保在升级vim安装时不会丢失任何自定义插件或修改。

For example 例如
There is a syntax file called cpp.vim in vim72/syntax . vim72/syntax有一个名为cpp.vim的语法文件。
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. 如果您现在想要更改此语法文件中的一些内容(例如添加额外的关键字),您可以使用其他关键字语法规则在vimfiles / syntax中获得此语法文件的副本。
Now when you upgrade vim to 7.3, you still have all of your custom plugins and settings. 现在,当您将vim升级到7.3时,您仍然拥有所有自定义插件和设置。

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. 如果您要更改vim72/syntax/cpp.vim ,当您下次升级vim时,这些文件将被新版本覆盖,并且您所做的任何更改都将丢失。
Plus, since vim72/syntax/ contains all of the original syntax files, it would be more difficult to tell which of these you had customised. 另外,由于vim72/syntax/包含所有原始语法文件,因此更难以确定您自定义了哪些文件。

That 'vimfiles' directory is where you can install things system-wide without touching Vim's installation directory ('vim72'). 那个'vimfiles'目录是你可以在不触及Vim安装目录('vim72')的情况下在系统范围内安装的东西。 The directory 'vim72' is subject to change when upgrading and a new major or minor version will use a different directory (eg Vim 7.1 used 'vim71' and Vim 8.0 will use 'vim80'). 升级时目录'vim72'可能会发生变化,新的主要或次要版本将使用不同的目录(例如Vim 7.1使用'vim71'而Vim 8.0将使用'vim80')。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM