Notes to form draft of new tip
Trying to come up with some uses for tab pages, here's one idea:
:tabnew
(open a new window on each buffer you want to apply the command to)
:windo {command}
alternative:
:sp (or :tabnew) :arglocal (list of files to apply the command to) :argdo
Advantages of tab-page method:
- buffers don't necessarily need an associated file (but probably usually have one)
- can immediately see/compare the effect on each buffer without switching between them
- can still use :arglocal and :sall if most but not all of your buffers have files
- If you're not sure which files need the change applied, you can open each possible one in turn and close it if not needed (or just re-use the window). Or could use :grep to find all files that need the change, and use quickfix commands like CTRL-W_Enter to open each resulting file in a new window in the tab (could also use :argadd for this or a macro/mapping/command/function to go through each item in the qf list).
Possible expansion:
- command to open a new tab page to use for this purpose, plus command to add current buffer to this new tab page (use tab-specific variable to uniquely identify the tab in case it gets moved? keep buffers in a list and open the tab after the list is created?)
- command to open a new window for each file in the quickfix list
- make use of moving windows between tabs tip?