如何设置vim配置文件的路径?

时间:2011-03-28 00:21:57

标签: ruby vim

我知道他们说要将vim配置文件存储在源代码管理下。

有没有办法告诉vim配置文件在哪里?像.vimrc等?

即。我将它们存储在我的其他git存储库所在的不同文件夹中。

BTW,什么是红宝石的好着色插件?

2 个答案:

答案 0 :(得分:3)

如果要将所有git存储库保存在一个位置,可以使用VIM环境变量更改~/.vim/目录的位置。有关更多详细信息,请参阅:help $VIM部分,但这里的部分看起来最有用:

The environment variable "$VIM" is used to locate various user files for Vim,
such as the user startup script ".vimrc".  This depends on the system, see
|startup|.

如果您将export VIM=/home/blankman/git/vim/添加到~/.bashrc,则应该设置。

答案 1 :(得分:2)

摘自vim man页面:

-u {vimrc}  Use  the  commands in the file {vimrc} for initializations.
               All the other initializations are  skipped.

要在运行vim时让它工作,请尝试输入shell的启动脚本(.bashrc等):

alias vim='vim -u /path/to/vimrc'

链接:http://www.h3rald.com/articles/herald-vim-color-scheme/

有一些使用ruby突出显示示例的方案。 Vim看起来有很好的原生红宝石支持,所以你可能只想要一个新的配色方案。

浅色的Ruby突出显示方案here

相关问题