martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.23k stars 256 forks source link

Command to save multiple files #889

Closed sauterp closed 3 years ago

sauterp commented 3 years ago

Request A command to save all or a subset of the files opened in a session.

Use case I frequently use vis to edit multiple files concurrently with commands such as :X//x/oldName/c/newName/. To save all the changes I made, I have to execute :w in every window.

Suggestions

  1. It would be convenient to have something akin to :wa or :wqa as in vim. There is a :qall command but no :wall command.
  2. A command along the lines of :X/*.c/ w would be useful as well.
martanne commented 3 years ago

There is a :qall command but no :wall

In principle :qall should be removed in favor of :X q.

A command along the lines of :X/*.c/ w would be useful as well.

This should work, but using a regexp not a glob pattern i.e. :X/\.c$/ w.

Note however that X and Y currently work on windows not files. Meaning that if you have the same file opened more than once, the command will also be run multiple times.

sauterp commented 3 years ago

Thank you for the hint about not using a glob pattern, that was my problem.

In principle :qall should be removed in favor of :X q.

I agree, in general there should be only one way to do something, unless a shorthand for a complicated common task is needed. Not sure if it's necessary to remove :qall though.