When Vim starts, it displays the tilde symbol (~
) for empty lines. Is there a way to change its color?
Try this:
:highlight NonText ctermfg=12
12 is the default color; change as you see fit.
In Vim 8, you can set the EndOfBuffer
highlight group separately from NonText
:
highlight EndOfBuffer ctermfg=bg
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.
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*
For standard Vim 8.x, the following works:
:highlight EndOfBuffer ctermfg=*color*
This colors tildes at the end of buffers into a specifically determined color.
For gVim 8.x, the following is smoother:
:highlight EndOfBuffer guifg=bg
This is better since it colors tildes at the end of buffers into the color of the background, effectively making such tildes transparent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With