diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index 72a80bf..d1fc95c 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -59,3 +59,10 @@ autocmd SourcePost termdebug.vim tnoremap " Adjust the colorcolumn together with &textwidth autocmd OptionSet textwidth let &colorcolumn=&textwidth +" +" Highlight word under cursor +augroup highlight_current_word + au! + au CursorHold * :exec 'match CursorColumn /\V\<' . escape(expand(''), '/\') . '\>/' + au CursorMoved * :exec 'match' +augroup END