Yes, look at :help listchars
.
listchars
is a string that will be parsed when list
is set to determine what to render for certain special characters. You can set listchars
in your .vimrc
like so:
set listchars=eol:!,tab:>=,trail:.
set list
This will use the !
character to show the end of every line, tabs like >===
(assuming four-space tabs), and trailing spaces with a .
character. The characters are highlighted with the SpecialKey
group.
In addition, you can include the following tokens in listchars
:
extends:<character>
for the last character in a long line
precedes:<character>
for the first character in a long line
conceal:<character>
for concealed text
nbsp:<character>
for non-breaking spaces
Note that you cannot get vim to display visible whitespace for spaces that are not trailing without a relatively modern version of vim; check if has("patch710")
to see if space
is supported in listchars
.