Change tilde (~) color in Vim

Tag: vim Author: gyboys Date: 2009-08-02

When Vim starts, it displays the tilde symbol (~) for empty lines. Is there a way to change its color?

Best Answer

Try this:

:highlight NonText ctermfg=12

12 is the default color; change as you see fit.


But this affects visibility of the list chars at the same time!

Other Answer1

I can't leave comments yet, so this will have to be an answer..

Lucas is correct, but you must remember that this will also change the color of the characters shown when you :set list. If you are attempting to hide these tildes, you will also hide those characters.

Other Answer2

Lucas is right but if you want to change the colour in gvim as well I think you need guifg= as well as ctermfg=

i.e. :highlight NonText ctermfg=color guifg=color

Other Answer3

You could try a new color scheme.

:colors <colorscheme name>

You can find the names of the schemes installed on your system in $VIMRUNTIME/colors/ Also, if the 'bg' option isn't set properly, those little tildes can be hard to see.