diff options
author | Max Christian Pohle | 2018-10-22 00:02:58 +0200 |
---|---|---|
committer | Max Christian Pohle | 2018-10-22 20:42:25 +0200 |
commit | f2e01d7e513067ddb57c75f6e38cdcf434946cf8 (patch) | |
tree | 4e8448506756d2144db173d01385798840507133 /plugin/max-highlight-word-under-cursor.vim | |
parent | 31f80d9c334e38e486545407ea5eb5f5cbb2f07d (diff) | |
download | vim-karlmarks-f2e01d7e513067ddb57c75f6e38cdcf434946cf8.tar.bz2 vim-karlmarks-f2e01d7e513067ddb57c75f6e38cdcf434946cf8.zip |
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.
Diffstat (limited to 'plugin/max-highlight-word-under-cursor.vim')
-rw-r--r-- | plugin/max-highlight-word-under-cursor.vim | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ | |||
1 | "======================================================================================================================= | ||
2 | " HIGHLIGHT_WORD_UNDER_CURSOR: | ||
3 | "======================================================================================================================= | ||
4 | |||
5 | let w:m1 = 0 | ||
6 | function! HighlightWordUnderCursor() | ||
7 | if(exists('w:m1') && w:m1 > 0) | ||
8 | silent! call matchdelete(w:m1) | ||
9 | let w:m1 = 0 | ||
10 | endif | ||
11 | let l:currentword = escape(expand('<cword>'), '.') | ||
12 | if(strlen(l:currentword) > 0) | ||
13 | let w:m1=100 | ||
14 | silent! call matchadd('BoldUnderline', '\<'.l:currentword.'\>', -1, w:m1) | ||
15 | endif | ||
16 | endfunction | ||
17 | |||
18 | autocmd CursorHold,CursorHoldI * call HighlightWordUnderCursor() | ||