Created
August 6, 2013 22:24
-
-
Save 0xv/6169297 to your computer and use it in GitHub Desktop.
VIM highligting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment