I'm looking for a way to add a new full-height window split to an existing (splitted) window configuration. Because I don't know how to explain it properly I'll just post some ASCII graphics showing the desired behaviour for two example window configurations:
from to +-------------------------+ +---------------------+---+ | | | | | | | | | | | A | => | A | E | | | | | | | | | | | +-------------------------+ +---------------------+---+ +------------+------------+ +----------+----------+---+ | | B | | | B | | | A +------------+ | A +----------+ | | | C | => | | C | E | +------------+------------+ +----------+----------+ | | D | | D | | +-------------------------+ +---------------------+---+
where the function accepts the desired width of the new window E
and shrinks the widths of A
, B
, C
, and D
accordingly. Edit2: Note that the above two drawings are examples of the expected behaviour for a concrete case. I'm looking for a general function that does this independently of the configuration in the from column (i.e. the number of windows [splits] in the from column should be arbitrary).
I'm also looking for this functionality on the left side and on the top and bottom of a frame.
Edit: From @Nsukami_'s comment I realised that the functionality I'm looking for is a special case of a more abstract problem. So I'll phrase that problem:
How do you store a window configuration (consisting of any number of windows and buffers) and "paste" the stored config into an existing window?
The "paste" should then preserve relative window sizes and the splitting; naturally the resulting pasted config is a scaled copy.
split-window-right
asC-u -width C-x 3
. Change thewidth
to whatever you want and note the negative sign.A
,B
,C
, andD
) and then insert this layout into a new window? Then my problem could be solved by 1) storing the current window config, 2) changing the layout to show only one window which is then split horizontally [essentially forming the window forE
and the placeholder window for the others, lets call itZ
], 3) finally insertion of the original layout into the left window (Z
)