4

A tilde appears on the terminal if the file contain less lines than the screen currently displays. I was wondering if it is possible to remove them or replace them with something more beautiful (maybe a single line of underscores or something)

Here is an empty file full of tildes on a new vim without even a vimrc: Here is an empty vim window with the ugly tildes

3
  • 1
    Welcome to Vi and Vim! I believe based on :help filler-lines that these are hard-coded in the source, but I can't find a reference on that – D. Ben Knoble Feb 1 at 16:58
  • 1
    Also if someone with higher score see this: I believe I put a wrong tag as there where no tags about cosmetics ,I would propose one – Spyros Mourelatos Feb 1 at 17:36
  • 1
    The best tag I could find is margin and the handful of questions associated with it do suggest, IMO, that it's appropriate (though maybe not perfect). – B Layer Feb 2 at 2:32
5

Since 8.2.2508, you can hide the tilde by setting the 'fillchars' option:

let &fillchars ..= ',eob: '

Credit to Yegappan Lakshmanan for submitting the PR #7832.

1
  • I will change my accepted answer as this one is a little bit more accurate(even though Quasimodos answer was fine for non-opaque terminals and Matts answer was very similar but neovim specific) – Spyros Mourelatos Feb 15 at 7:27
4

I'm with Ben here: The tilde seems to be hardcoded. However, you can set their foreground color to match the background color so that they effectively disappear:

:hi EndOfBuffer ctermfg=black
2
3

To be fair, in Neovim you can.

set fillchars+=eob:*

Also to note :h 'fillchars' in Neovim is local to window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.