:h autoread
says:
When a file has been detected to have been changed outside of Vim and it has not been changed inside of Vim, automatically
Outside of gvim, autoread doesn't work for me.
To get around this I use this rather ugly hack.
set autoread
augroup checktime
au!
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
This seems to be what the script irishjava linked to does, but that lets you toggle this for buffers. I just want it to work for everything.