With 'autoread'
, Vim just has to check the file modification time. Since the netrw targets reside on a different system, that lookup will be most costly and you have to trigger it yourself. One idea is to perform that check on the FocusGained
event, i.e. when you come back to your (home machine's) Vim. Since on Windows GVIM, the netrw access pops up a console window (triggering another FocusGained
), and to avoid too frequent checks, let's limit the check to a certain time interval, e.g. at most every 5 minutes:
:autocmd FocusGained ftp://*,scp://* nested
\ if ! &modified && ! exists('b:lastchecktime') || localtime() - b:lastchecktime > 300 |
\ edit! |
\ let b:lastchecktime = localtime() |
\ endif