In recent versions of Vim there's a 'listchars' setting that lets you specify which characters should be used for the EOL and TAB characters, and for trailing spaces.
You could:
set listchars=eol:$,tab:\[SPACE]\[SPACE]
...to display eol chars specially without collapsing tabs (type a space character, not [,S,P,A,...).
I don't know of anything specifically about return chars in the 'listchars' setting, but I suspect you can use syntax highlighting for this.
I think the default display of \r characters is to show them with SpecialKey highlighting.
So the default SpecialKey highlighting of \r characters, combined with setting 'listchars' as above, should be close to what you need.
:highlight SpecialKey ctermfg=5
...if you're fond of magenta.
SpecialKey is the built-in syntax-highlighting label for any characters which are displayed "specially": control chars and the like. If you type ":highlight SpecialKey", that'll tell you how those characters will be displayed. – njd – 2010-02-09T10:21:45.707
When I try the
set listchars
I get the following error:E474: Invalid argument: listchars=eol:$,tab:\[SPACE]\[SPACE]
. I am using MacVim 8.0.596 (133) – Eliot – 2017-05-10T20:55:35.127Thanks,
– watain – 2010-01-19T11:38:59.443listchars
already helped. Would you mind to explain me how to useSpecialKey
? I can't find any useful information, http://vimdoc.sourceforge.net/htmldoc/syntax.html#hl-SpecialKey didn't help much either.