How to only highlight comments in vim
I prefer1 to parse code and literature with my mind and eyes, not weird highlighting. So I usually have syntax highlighting off. But having commented out code look different is really helpful. If you would like that kind of setup, drop
" Turn off all syntax highlighting except comments and errors which are actually useful. set t_Co=256 syntax on highlight Comment cterm=italic ctermfg=none highlight Error ctermfg=yellow highlight Constant ctermfg=none highlight Identifier ctermfg=none highlight Statement ctermfg=none highlight PreProc ctermfg=none highlight Type ctermfg=none highlight Special ctermfg=none highlight Underlined ctermfg=none
into your .vimrc If you use gvim
instead of vim
at the console, you need to replace those ctermfg
's with guifg
's.
-
Not anymore (2015). ↩