If I have multiple files in tabs on VIM and I edit few of them. How to save them with one command?
This is where your file will be saved if simply enter :w filename . You can change the working directory with :cd path/to/new/directory . Or you can enter the full path to the location where you want to save the file with the write command, e.g., :w /var/www/filename . Save this answer.
The command wa (short for wall) will write all changed buffers. You can also use :tabdo w, which is definitely exactly what you want, and generalizes nicely.
Just do
:wa
(followed by return) which is a shorthand for
:wall
Also to "save everything and exit" you can do
:wqa or :xa
(="write-quit-all")
It's possible to suffix a[ll] for a number of Vim command-line commands (i.e. type : when in normal mode), include:
:wa - save all tabs / unsaved buffers
:xa/:wqa - save all tabs / unsaved buffers and exit Vim
:qa - exit vim (will warn if unsaved buffers exist)
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