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?

- 27,830
- 11
- 80
- 100

- 2,201
- 17
- 29
-
Duplicate: http://stackoverflow.com/questions/1294790/tilde-color-in-vim/ – Randy Morris Sep 16 '10 at 12:39
-
1Although I hadn't seen that question when asking this, I think it's not a duplicate in that this is asking about changing the character, not the colour of that character. – lukerandall Sep 16 '10 at 15:05
-
Does this answer your question? [Is it possible to not display a ~ for blank lines in Vim?](https://stackoverflow.com/questions/3813059/is-it-possible-to-not-display-a-for-blank-lines-in-vim) – jdhao Oct 31 '20 at 07:34
2 Answers
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

- 21,412
- 9
- 33
- 48
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

- 27,830
- 11
- 80
- 100
-
Unfortunately I do use listchars, so that won't help. Thanks for answering though! – lukerandall Sep 16 '10 at 15:01
-
3
-
2@devth: Yeah, it shouldn't be a complicated change to allow users to configure the character through the `fillchars` option, for example. – ib. Jun 09 '13 at 01:10