Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whitespace under the cursor in vim

I recently saw this demo. My question is: how is it possible in vim to show whitespace characters under the cursor as dots (in red for example).

like image 932
akosch Avatar asked Nov 23 '25 14:11

akosch


1 Answers

I don't think that's showing space under the cursor; I think it's showing trailing spaces. This is controlled by the listchars option, which controls the behavior of list. To turn it on, use:

set list
set listchars=trail:·

The color is determined by the hl-SpecialKey group; you can change it like this:

hi SpecialKey ctermfg=Red
like image 147
Cascabel Avatar answered Nov 26 '25 17:11

Cascabel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!