Here’s a quick snippet that you can add to your .vimrc in order to get:
The result looks like this:
And the code is:
function Matches()
highlight curword ctermbg=white ctermfg=black cterm=bold gui=bold guibg=darkgrey
try
call matchdelete(w:lastmatch)
unlet w:lastmatch
catch
endtry
silent! let w:lastmatch=matchadd ('curword', printf('\V\<%s\>', escape(expand(''), '/\')), -1)
highlight eolspace ctermbg=red guibg=red
2match eolspace /\s\+$/
endfunction
au CursorMoved * exe 'call Matches()'
Yes, one day I might convert it to a vim plugin, meanwhile just copy-paste to your .vimrc.
Enjoy!
August 28th, 2013 at 01:18
Awesome!