7

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
    Commented Feb 1, 2021 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 Commented Feb 1, 2021 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
    Commented Feb 2, 2021 at 2:32

3 Answers 3

8

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) Commented Feb 15, 2021 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 and acknowledge you have read our privacy policy.

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