Vim:如何在/ usr / share / vim / gvimrc之后加载脚本

时间:2014-11-25 03:26:49

标签: vim vim-plugin vim-syntax-highlighting

正如我在this question中问(并回答了自己),一些vim脚本阻止了颜色方案solarized.vim正确加载。我找到了一种解决方法,即在 solarized.vim之后加载或中的/usr/share/vim/gvimrc

但是,即使作为一种解决方法,它也不是最佳的,因为我希望我的所有自定义都驻留在我的~/.vim目录(或至少我的$HOME目录中)。

所以这是我的问题:

  • 如何在/usr/share/vim/gvimrc之后加载脚本?

特别是,如果我可以创建一个脚本solarized.vim,在其中放置一行colo solarized,并在gvimrc之后加载。

1 个答案:

答案 0 :(得分:1)

快速简便的方法:创建一个〜/ .gvimrc并将命令放在那里。

但是,如果你想把所有东西保存在〜/ .vim中,你可以尝试http://vimdoc.sourceforge.net/htmldoc/gui.html#gvimrc中的建议和类似的东西到你的〜/ .vim / vimrc文件中:

If you want some commands to be executed just after opening the
GUI window, use the |GUIEnter| autocommand event.  Example:
    :autocmd GUIEnter * colo solarized