You could accomplish something like this using the argument list. The general idea is to collect all of the open windows into the argument list, then close all the splits, then use the argument list to open everything in a new way.
First, clear the argument list, in case it's already populated.
:argdelete *
Next, collect all the windows into the argument list.
:tabdo windo argadd %
:tabdo
performs a command on each tab, visiting one at a time
:windo
does the same in each window of the current tabpage
:argadd %
adds the current buffer to the argument list
Now we have all of the windows in the argument list. Let's close all but one window.
:tabonly | only
:tabonly
closes all tab pages except the current one
:only
closes all windows except the current window in the current tab page
Flip to the first argument.
:first
Now we'll cycle through all of our arguments and open them in the style of our choosing.
:argdo tabedit %
Change tabedit
to split
or vsplit
as desired.
NOTE: I haven't figured out why yet, but this duplicates the last window. We can just close it with :quit
(or :q
for short).
Caveats
- This clobbers your argument list, if you had one
- If you have
'equalalways'
turned off (i.e. :set noequalalways
) and you're using this for opening windows in splits, you may quickly run out of screen space before opening all the windows
-p
,-o
,-O
which appear in different split layouts, but I'd like to know how to switch between different layouts while I'm editing them (in the editor, without quitting and re-opening files again).