有时候要使用VIM打开了一些文件,但是在其他地方把次文件改动了,例如使用git进行checkout等操作,需要重新载入此文件。
1 重新载入当前文件:
:e
:e! #放弃当前修改,强制重新载入
2 重新载入所有打开的文件:
:bufdo e 或者 :bufdo :e!
:bufdo命令表示把后面的命令应用到所有buffer中的文件。
参考网址:Refresh all files in buffer from disk in vim, Run a command in multiple buffers
]]>if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
如果已经有, 去掉注释即可.
]]>