Currently, when my window is bigger than the buffer being displayed, blank lines beyond the end of file are shown with the ~
characters in the line number column. I would prefer for the line number column for those lines to be blank. Is it possible to make it so?
As of Vim 8.0, the color of the filler line character (~) can be changed indepedently by configuring the EndOfBuffer
highlight group:
highlight EndOfBuffer ctermfg=bg guifg=bg
Unfortunately, it is not possible to change the tilde character that Vim uses to show the lines beyond the end of a file (without modifying the source code).
A viable workaround is to hide those tildes by configuring the
NonText
highlight group, which is used for displaying them,
so that its foreground color is the same as the background one:
:highlight NonText ctermfg=bg guifg=bg
However, this approach is not a complete solution, because this
highlighting group is also used for rendering the list characters
(see :help 'list'
and :help 'listchars'
), making it impossible to
specify highlighting just for the beyond-last-line markings.
Starting with version 8 (see :helpg Patch 7.4.2213
), Vim allows
to highlight the filler lines after the last line in a buffer using
a separate highlighting group called EndOfBuffer
:
:highlight EndOfBuffer ctermfg=bg guifg=bg
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