Vim: Can I use dashes instead of tildes for empty lines?

Just started trying to get serious with vim. The big thing everyone raves about with vim is: "You can set it all up!" and I like little things about my environment. One of the first things that listened to me was the tildes ( ~ ) on the left side of the screen for blank lines. I would like to change them to a dash ( - ), but I can’t understand for life how?

+5
source share
2 answers

Unfortunately, you cannot change ~ to any other character.

If ~ listening to you, you can hide it with the NonText highlight group, which is used to display them by setting the foreground color with the same background color:

 :highlight NonText ctermfg=bg guifg=bg 

Unfortunately, this also has consequences, see :h list for an example.

Coming back, I’d better adapt to the tiny ~ Some people think it's beautiful :)

PS Based on Josh's discovery, they discovered issue # 4181 in neovim repo

+7
source

~ hardcoded. If you want to rebuild vim from the source code, you can probably do this by changing the win_draw_end call that exists at the end of the (rather epic) win_update function in screen.c . This is, in particular, on line 2142 at the time of writing .

(Since rebuilding from the source is a bit extreme, Deleisha's suggestion of “hiding" ~ with the appropriate syntax highlighting is probably much better for the average user.)

+3
source

Source: https://habr.com/ru/post/1242259/


All Articles