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?

  • 1
    Setting 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
  • Thanks. Any thoughts on why it would suddenly stop working after working ok? I'm fairly new to vim and have been playing with different plugins. Perhaps there is some kind of conflict? It's not a big deal but I'm trying to get more familiar with vim and understand how it works better. – StevieD Mar 10 '17 at 2:06