From 8d5389a879439d0ddf4bfb270a8ee1ae55b17f35 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 20 Oct 2017 12:39:20 +0200 Subject: [PATCH] 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. --- vimrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 5ed7815..318d9c7 100644 --- a/vimrc +++ b/vimrc @@ -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(""), "\\")."\\>" - let b:hlwuc = matchadd("Underlined", str) + let b:hlwuc = matchadd(hl, str) "echom str endfunc function! s:toggleWUC()