I would like to set a different highlighting for windows EOL characters.
I have tried several approaches and some of them worked when I did : so $MYVIMRC
, which is pretty strange, because after I closed and reopened a file these effects were gone.
I tried:
call matchadd("NewLineWin", "\r\n")
call matchadd("NewLineWin", "\r\(\n\)\@=")
call matchadd("NewLineWin", "\r(?=\n)")
And none of these worked after reopening the file.
There is no error in the highlight setting, because, if I change the matchadd call to this call matchadd("NewLineWin", "\r")
everything works normally. But I doubt that this is an acceptable approach, since Windows EOL are \r\n
and not simply \r
. Besides, I'm wondering what is wrong with my regex.
Could anyone help me with this, please?
[%{&ff}]
to your'statusline'
. Newlines are represented by, well, new lines in Vim.\r\n
at the and of a line ? I did this and saw no difference.SpecialKey
group. Pretty hard to miss.