If my .vimrc file has this:
set background=dark
highlight Comment term=bold ctermfg=white
...comments are white as expected.
But if I reverse the order of the statements:
highlight Comment term=bold ctermfg=white
set background=dark
...comments are light blue.
But what really has me confused is that I had highlight
directive before the background
directive for the longest time and comments were still white. Now all of a sudden I'm seeing this behavior. What can explain this?
background
reloads the colorscheme, which resets the default highlight groups. It's basically the same problem as in Why do custom highlights in my vimrc get cleared or reset to default? – Martin Tournoij Mar 10 '17 at 2:01