I put this command in ~/.vimrc. au! FileChangedShell img.dat r img.dat which also contains set autochdir " pwd is always directory of current buffer I hoped to ensure that, if the file img.dat exists in pwd and
it is modified by some app other than vim, then vim would read
the new img.dat into the current buffer. It does not, nothing
happens. v:fcs_reason is unset :if exists("#FileChangedShell") | echo 'yes' | else | echo 'no' | endif returns 'yes' What am I missing?
It also only fires if you're currently editing a buffer for that file. You can't monitor arbitrary files which are not open in Vim using that autocmd, which seems to be what you're trying to do for some reason.
Thank you both, Marco and Ben Fritz, for your info. I had interpreted FileChangedShell to mean that if I had a buffer for img.dat in vim, I could automatically read its update into another buffer exactly where I want the new data to end up. In other words, completely effortless on my part.
The img.dat buffer is duly updated, but the r command to read it into the active buffer does not operate. Can it be done?