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
|
unlet w:cword_match_id
|
||||||
endif
|
endif
|
||||||
if (expand('<cword>') != '')
|
if (expand('<cword>') != '')
|
||||||
let w:cword_match_id = matchadd('CursorColumn',
|
let w:cword_match_id = matchadd(
|
||||||
\ '\V\<' . escape(expand('<cword>'), '/\') . '\>')
|
\ 'CursorColumn',
|
||||||
|
\ '\V\<' . escape(expand('<cword>'), '/\') . '\>',
|
||||||
|
\ -1)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
augroup highlight_current_word
|
augroup highlight_current_word
|
||||||
|
|||||||
Reference in New Issue
Block a user