简体   繁体   English

两个vimfiles目录。 我在哪里安装插件?

[英]Two vimfiles directories. Where do I install my plugins?

I'm using Windows 10. 我正在使用Windows 10。

I want to give Vim another shot after having some troubles with it in the past. 在过去遇到过一些麻烦之后,我想再给Vim一炮而红。 I'm eager to learn it, but I'm confused. 我渴望学习它,但是我很困惑。 I gave a pretty thorough search to find my answer before I resorted to posting this here, but what is the proper way to install my vim plugins. 在诉诸于此之前,我进行了一次彻底的搜索以找到答案,但是安装vim插件的正确方法是什么。 I see two vimfiles folders in two different directories. 我在两个不同的目录中看到两个vimfiles文件夹。

One in the $HOME directory. $HOME目录中的一个。

C:\\User\\[USERNAME]\\vimfiles

And one in the installation directory. 并在安装目录中一个。

C:\\Program Files (x86)\\Vim\\vimfiles

Is there a reason for there being two of these ? 有两个原因吗? What's the best directory to install my plugins ? 安装我的插件的最佳目录是什么?

It is related to 'runtimepath' param. 它与'runtimepath'参数有关。 Read :help 'runtimepath' for more info . 阅读:help 'runtimepath'了解更多信息。 C:\\Program Files (x86)\\Vim\\vimfiles is system folder with default plugins which are shipped with vim itself. C:\\Program Files (x86)\\Vim\\vimfiles是带有vim本身随附的默认插件的系统文件夹。 C:\\User\\[USERNAME]\\vimfiles is your local runtimepath. C:\\User\\[USERNAME]\\vimfiles是您的本地运行时路径。 And there you should put your plugins. 在那里,您应该放置插件。 This way if you have multiple users they all will have own vim environment to work in. If you want you can even set different runtimepath but this is whole another question)) 这样,如果您有多个用户,他们都将拥有自己的vim环境。如果您希望甚至可以设置不同的运行时runtimepath但这是另一个问题))

C:\\User\\[USERNAME]\\vimfiles is your vim runtime files and C:\\Program Files (x86)\\Vim\\vimfiles is Vim 's runtime files. C:\\User\\[USERNAME]\\vimfiles您的 vim运行时文件,而C:\\Program Files (x86)\\Vim\\vimfilesVim的运行时文件。 As long as a feature is present in your vim runtime files and vim request it, it will load them and if its not present there, then it will fallback to his runtime path to find it (ie C:\\Program Files (x86)\\Vim\\vimfiles ). 只要您的vim运行时文件中存在某个功能并且vim请求该功能,它就会加载它们,如果该功能不存在,它将回退到他的运行时路径中进行查找(即C:\\Program Files (x86)\\Vim\\vimfiles )。 So you should always install your plugins, colorschemes, syntaxes, ... in your vim runtime files and also back it up in a safe place and never touch vim's runtime files. 因此,您应始终在vim运行时文件中安装插件,colorschemes,语法,...,并将其备份在安全的地方,切勿触摸vim的运行时文件。

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

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