Refresh all files in buffer from disk in vim

前端 未结 5 1716
予麋鹿
予麋鹿 2021-01-29 19:18

The command to refresh a file from version on disk is :e!

How can I do the same for all files in the buffer?

Background: I need that because I am u

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-29 19:36

    The :checkt[ime] command is designed for this very purpose.

    It will prompt you to reload any buffers that have changed; if you wish to skip the prompt, you can do :set autoread beforehand (you'll still get a prompt on buffers with local unsaved changes).

    It also avoids the syntax highlighting issue mentioned by Steven Lu on the accepted answer; :bufdo turns off syntax highlighting by design.

    Found via: http://vim.1045645.n5.nabble.com/Bug-report-bufdo-e-breaking-syntax-highlighting-on-displayed-buffers-tp1209995p1209998.html

提交回复
热议问题