vim Configuring Vim Syntax Highlighting


Example

Switch syntax highlighting on, when the terminal has colors

if &t_Co > 2 || has("gui_running")
    syntax on
end

Show trailing whitespace and tabs. Showing tabs can be especially useful when looking for errors in Makefiles.

set list listchars=tab:\|_,trail:.
highlight SpecialKey ctermfg=DarkGray