From cc86bdf4af5212a3b2a7960e65c402eac71091c1 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 25 May 2019 00:01:23 +0200 Subject: plugin/better_autoread.vim: Disable automatic `checktime` on Vim 8 I kept getting E211 errors when switching Git branches with added/missing files or E321 errors. Normally, I'd get the error once, dismiss it, and be done with it, but on a new machine with a recent Vim install, the errors kept coming back up every few seconds, insupportable. Unless I can think of something better, take a heavy-handed approach and disable this on new Vims. --- plugin/better_autoread.vim | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'plugin') diff --git a/plugin/better_autoread.vim b/plugin/better_autoread.vim index e8625a1..73eae6c 100644 --- a/plugin/better_autoread.vim +++ b/plugin/better_autoread.vim @@ -7,16 +7,19 @@ " http://stackoverflow.com/a/10962191 set autoread -augroup checktime - autocmd! - if !has("gui_running") - "silent! necessary otherwise throws errors when using command - "line window. - autocmd BufEnter * silent! checktime - autocmd CursorHold * silent! checktime - autocmd CursorHoldI * silent! checktime - "these two _may_ slow things down. Remove if they do. - " autocmd CursorMoved * silent! checktime - " autocmd CursorMovedI * silent! checktime - endif -augroup END + +if v:version <# 800 + augroup checktime + autocmd! + if !has("gui_running") + "silent! necessary otherwise throws errors when using command + "line window. + autocmd BufEnter * silent! checktime + autocmd CursorHold * silent! checktime + autocmd CursorHoldI * silent! checktime + "these two _may_ slow things down. Remove if they do. + " autocmd CursorMoved * silent! checktime + " autocmd CursorMovedI * silent! checktime + endif + augroup END +endif -- cgit v1.2.3