Vim: How to load a script after /usr/share/vim/gvimrc

126 views Asked by At

As I asked (and answered myself) in this question, some vim script is preventing the color scheme solarized.vim to load correctly. And I have found a workaround which is to load solarized.vim in or after /usr/share/vim/gvimrc.

However, even as a workaround it's not optimal, because I hope all my customization would reside in my ~/.vim directory (or at least my $HOME directory).

So here is my question:

  • How to load a script after /usr/share/vim/gvimrc?

Especially, If I can create a script solarized.vim, putting a single line colo solarized in it, and let it loaded after gvimrc.

1

There are 1 answers

1
Eric On BEST ANSWER

The quick and easy way: create a ~/.gvimrc and put your commands in there.

If you want to keep everything in ~/.vim, however, you could try the suggestion from http://vimdoc.sourceforge.net/htmldoc/gui.html#gvimrc and something like this to your ~/.vim/vimrc file:

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