Custon HL group for word under cursor

The variable b:word_hl can now be set to set a custom highlighting group
for the word-under-cursor functionality.
This commit is contained in:
Talia 2017-10-20 12:39:20 +02:00
parent 98e757172b
commit 8d5389a879

7
vimrc
View file

@ -156,8 +156,13 @@ function! s:updateWUC()
call matchdelete(b:hlwuc)
end
end
if exists("b:word_hl")
let hl = b:word_hl
else
let hl = "Underlined"
endif
let str = "\\<".escape(expand("<cword>"), "\\")."\\>"
let b:hlwuc = matchadd("Underlined", str)
let b:hlwuc = matchadd(hl, str)
"echom str
endfunc
function! s:toggleWUC()