Reputation: 31
I got this from the vim wiki and added it to my .vimrc to highlight trailing whitespace, and spaces before tabs (only when in insert mode):
highlight ExtraWhitespace guibg=purple
match ExtraWhitespace /\s\+$\| \+\ze\t/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$\| \+\ze\t/
autocmd InsertEnter * match ExtraWhitespace /\s\+$%#\@<!$\| \+\ze\t/
autocmd InsertLeave * match ExtraWhitespace /\s\+$\| \+\ze\t/
autocmd BufWinLeave * call clearmatches()
I would like to extend this to include spaces after tabs.
So, I would like to:
How can I do this?
Upvotes: 3
Views: 3126
Reputation: 2734
Since you didn't mention it at all have you tried using listchars? I have this in my .vimrc it doesn't highlight them but you can pick any special characters you want to show for them:
set listchars=eol:$,tab:>-,trail:·,extends:>,precedes:<
Upvotes: 1