vim:autocmd: Highlight word under cursor

This commit is contained in:
2022-02-17 15:21:51 +01:00
parent e268a2fd57
commit 9796992737

View File

@@ -59,3 +59,10 @@ autocmd SourcePost termdebug.vim tnoremap <Esc> <C-\><C-n>
" Adjust the colorcolumn together with &textwidth " Adjust the colorcolumn together with &textwidth
autocmd OptionSet textwidth let &colorcolumn=&textwidth autocmd OptionSet textwidth let &colorcolumn=&textwidth
"
" Highlight word under cursor
augroup highlight_current_word
au!
au CursorHold * :exec 'match CursorColumn /\V\<' . escape(expand('<cword>'), '/\') . '\>/'
au CursorMoved * :exec 'match'
augroup END