Setting the Vim background colors

Maksim Vi. picture Maksim Vi. · Jul 13, 2009 · Viewed 285k times · Source

When I try to change the background colors in .vimrc or directly in Vim using the command:

set background=dark

... it doesn't affect my background at all. Neither does the light option. However, it looks okay when I run gvim.

Is there a way to change the background in Vim without changing my Konsole settings?

EDIT Okay, there is a difference between guifg/guibg and ctermfg/ctermbg. While the GUI accepts lots of different color combinations, cterm allows only few standard ones.

Answer

Alex Martelli picture Alex Martelli · Jul 13, 2009

As vim's own help on set background says, "Setting this option does not change the background color, it tells Vim what the background color looks like. For changing the background color, see |:hi-normal|."

For example

:highlight Normal ctermfg=grey ctermbg=darkblue

will write in white on blue on your color terminal.