From f2e01d7e513067ddb57c75f6e38cdcf434946cf8 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 22 Oct 2018 00:02:58 +0200 Subject: Major refactoring for version 2.0 vim-plug has been removed and replaced with Vims internal bundle mechanism. But I already noticed, that there is also GLVM now and started trying that as well. --- plugin/max-highlight-word-under-cursor.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugin/max-highlight-word-under-cursor.vim (limited to 'plugin/max-highlight-word-under-cursor.vim') diff --git a/plugin/max-highlight-word-under-cursor.vim b/plugin/max-highlight-word-under-cursor.vim new file mode 100644 index 0000000..d557b40 --- /dev/null +++ b/plugin/max-highlight-word-under-cursor.vim @@ -0,0 +1,18 @@ +"======================================================================================================================= +" 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 + silent! call matchadd('BoldUnderline', '\<'.l:currentword.'\>', -1, w:m1) + endif +endfunction + +autocmd CursorHold,CursorHoldI * call HighlightWordUnderCursor() -- cgit v1.2.3