Get rid of illegible vim syntax highlighting

I often wondered why the default syntax highlighting in vim is almost illegible (e.g., dark blue on black background).

The reason is that a syntax highlighting in vim defines two sets of colors, one for light background and one for dark background.

To find out your current color scheme, type:

:set background

To (temporarily) switch to the color scheme for dark background use:

:set background=dark

Vice versa, for light background, use:

:set background=light

To make these changes permanent, add the command without colon (set background=[dark|light]) to ~/.vimrc.

Leave a Reply