Extremely related to this except the answer there doesn't work
I get the following error when entering command-line editing mode
Ctrl-F (when already in command mode)
Error detected while processing CursorHold Auto commands for "*": E11: Invalid in command-line window; <CR> executes, CTRL-C quits: checktime | endif
The relevant section of my .vimrc is
"automatically reload file when changes detected set autoread "this doesn't work on it's own! "https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044 "on these events, any filename... and not in command mode then check files for changes autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif " Notification after file change autocmd FileChangedShellPost * \ echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl None
So my question is how do I detect that I'm in the command-line window and stop that command from running there?
After a bit of reading
:h command-line I tried replacing the condition with
if mode() != 'c' && getcmdwintype() == ''
but I'm still seeing the same issue.