Skip to content

Instantly share code, notes, and snippets.

@0xv
Created August 6, 2013 22:24
Show Gist options
  • Save 0xv/6169297 to your computer and use it in GitHub Desktop.
Save 0xv/6169297 to your computer and use it in GitHub Desktop.
VIM highligting
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