を使用できますset autoread
。ディスク上でファイルが変更されたことを検出し、ファイルから現在のバッファを再読み込みします。したがって、ファイルを保存してスクリプトを実行すると、vim は変更内容でバッファーをリロードします。
Autoread のヘルプを以下にコピーします
*'autoread'* *'ar'* *'noautoread'* *'noar'*
'autoread' 'ar' boolean (default off)
global or local to buffer |global-local|
{not in Vi}
When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
When the file has been deleted this is not done. |timestamp|
If this option has a local value, use this command to switch back to
using the global value: >
:set autoread<