diff --git a/.config/vim/vimrc.d/70-functions.vim b/.config/vim/vimrc.d/70-functions.vim index b93492d..b91a7f6 100644 --- a/.config/vim/vimrc.d/70-functions.vim +++ b/.config/vim/vimrc.d/70-functions.vim @@ -7,3 +7,11 @@ function! CycleSpellLang() set spelllang=en endif endfunction + +" Check time every second to read file changes. +if (exists('+autoread') && &autoread) + function! CheckTime(timer) + checktime + endfunc + execute timer_start(1000, 'CheckTime', {'repeat': -1}) +endif diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index 2a0888b..be01ceb 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -53,9 +53,3 @@ else autocmd VimLeave * silent !echo -ne "\e[5 q" endif endif - -" Read file changes when cursor is not moved for &updatetime ms and then move -" cursor to restart the timer -if (exists('+autoread') && &autoread) - autocmd CursorHold * checktime | call feedkeys('hl') -endif