From cf9ffa6148bbc56c46992e706273c701beeb3055 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 20 Oct 2017 09:54:52 +0200 Subject: [PATCH] Improved word-under-cursor matching to *only* match whole words --- vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 5b8605a..603cad3 100644 --- a/vimrc +++ b/vimrc @@ -156,7 +156,9 @@ function! s:updateWUC() call matchdelete(b:hlwuc) end end - let b:hlwuc = matchadd("Underlined", expand("")) + let str = "\\<".escape(expand(""), "\\")."\\>" + let b:hlwuc = matchadd("Underlined", str) + echom str endfunc function! s:toggleWUC() augroup hlwuc