I have several
highlight commands in my
.vimrc file. In Vim 7.3, these took effect immediately after Vim had started. After updating to Vim 7.4, this is not the case anymore. Vim uses its default highlighting initially. When I load
.vimrc a second time by executing
source ~/.vimrc, highlighting works as I want.
You should be able to reproduce this problem using the following steps:
Make a copy of your
~/.vimrcwith a file that contains just the line
highlight Type ctermfg=28 cterm=bold.
vim dummy.cin a 256 color terminal (for example GNOME Terminal).
intinto the buffer. The
intshould appear in regular font and be colored light green, which is not what I want.
:source ~/.vimrc. Now the
intshould appear in bold font and be colored dark green.
According to the article How to control/configure vim colors, it should be okay to just put the
highlight commands into
.vimrc. The article says that you should put
syntax enable after the
highlight commands, but this did not make any difference.
My first fix was to prepend each
highlight command in
autocmd VimEnter *. This worked for some file types, but not for others (C files are an example).
What is the reason for this behavior? How can I have the
highlight commands executed when Vim is started such that they take effect for all buffers during the whole Vim session?