"======================================================================================================================= " HIGHLIGHT_WORD_UNDER_CURSOR: "======================================================================================================================= let w:m1 = 0 function! HighlightWordUnderCursor() if(exists('w:m1') && w:m1 > 0) silent! call matchdelete(w:m1) let w:m1 = 0 endif let l:currentword = escape(expand(''), '.') if(strlen(l:currentword) > 0) let w:m1=100 if(match(expand(''), '^#\x\{6\}') == 0) exec 'highlight! CurrentColor guibg='.expand('') hi CurrentColor " silent! call matchadd('CurrentColor', escape(expand(''), '.'), -1, w:m1) else silent! call matchadd('Underline', '\<'.l:currentword.'\>', -1, w:m1) endif endif endfunction autocmd CursorHold,CursorHoldI * call HighlightWordUnderCursor()