I have a few files open in vim, in multiple windows. Is there a command like :e that will reload the buffers for all the files I have open? I need this because I sometime alter some of the files with another editor while they are also open in vim.
Other ways to exit Vim Esc + :x + Enter (Save and exit) Esc + :qa + Enter (Quit all open files) Esc + Shift ZZ (Save and exit) Esc + Shift ZQ (Exit without saving)
:wa - save all tabs / unsaved buffers. :xa / :wqa - save all tabs / unsaved buffers and exit Vim.
The :windo
command does for windows what :bufdo
does for buffers. That is:
:windo e
should cycle through all visible windows (i.e, not windows on other tabs, if any) and execute the :e
command. Likewise:
:bufdo e
would cycle through all buffers in the buffer list (i.e., no "hidden" buffers) and execute the same command.
Note that you may have buffers in the buffer list that are not currently displayed in any window. So whether to use :windo e
or :bufdo e
depends on what you want.
Relevant help is here: http://vimdoc.sourceforge.net/htmldoc/windows.html#list-repeat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With