vim:autocmd: Highlight cword with lower priority
Use a priority of below 0 so that the cword highlighting does not overrule the highlighting of `hlsearch`.
This commit is contained in:
@@ -58,8 +58,10 @@ function! HighlightCurrentWord()
|
||||
unlet w:cword_match_id
|
||||
endif
|
||||
if (expand('<cword>') != '')
|
||||
let w:cword_match_id = matchadd('CursorColumn',
|
||||
\ '\V\<' . escape(expand('<cword>'), '/\') . '\>')
|
||||
let w:cword_match_id = matchadd(
|
||||
\ 'CursorColumn',
|
||||
\ '\V\<' . escape(expand('<cword>'), '/\') . '\>',
|
||||
\ -1)
|
||||
endif
|
||||
endfunction
|
||||
augroup highlight_current_word
|
||||
|
||||
Reference in New Issue
Block a user