I have the following in my
vimrc to automatically reload a buffer:
" Triger `autoread` when files changes on disk " https://unix.stackexchange.com/a/383044/143394 autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * checktime
The problem is if I'm in command-line mode (ie, after typing
: in normal mode), and I change focus away from, the back to vim I get:
Error detected while processing FocusGained Auto commands for "*": E523: Not allowed here: checktime
How can I prevent this autocmd running if I'm in command-line mode at the time?
Is there a flag set when entering commandline mode? Perhaps an autocmd could set one?