change comment colors in vim

technology

Syntax coloring in vim is pretty awesome. Comments however are by default blue. A color that is hard to read if you have a black background on a LCD screen.

It turns out that this pretty easy to change. For perl you would simply do:


mkdir -p ~/.vim/after/syntax/
echo highlight perlComment ctermfg=DarkGreen guifg=DarkGreen >> ~/.vim/after/syntax/perl.vim

This worked right away after adopting the C example of the documentation. I am sure that php etc will work similar.