Reputation: 44578
I’d like to save the files opened in all vertical/horizontal windows? Is it possible without going to each window and executing the :w!
command?
Upvotes: 10
Views: 3244
Reputation: 28954
To save only those buffers that opened in the current tab page and not
those that are hidden, run the :write
command for every open window:
:windo w!
In order to save all open buffers regardless of the corresponding
windows’ locations, run the :wall
command:
:wa!
There is also a similar command
:bufdo w!
but it does not behave in quite the same fashion. Both commands affect
hidden buffers, but :wall
does not attempt to write the buffers
that do not have a file name set.
Upvotes: 11
Reputation: 42228
Use :wall
It writes all changed buffers (but it will also save the hidden one).
Upvotes: 4