tags:

views:

148

answers:

4

In Vim I can move a split around. For example, if my window was split in two horizontally, with the topmost split split vertically (3 splits in total) I could move the top-right split to the right to become a vertical split taking up the entire vertical space.

Is this kind of rearrangement possible?

Update: I know resizing is possible, I'm looking to move though. I get the feeling this is not supported by Emacs.

+1  A: 

No, not by default. What you have to play with is basically C-x 0, C-x 1, etc. Look in the Emacs Wiki for extensions that may or may not do what you're looking for.

Deniz Dogan
+1  A: 

You may be interested by C-x + when you have more than 2 windows. It rearranges equally the windows on the frame. It's convenient for example when you do two C-x 2 in a row and want to have the windows to occupy the same space on the frame.

Jérôme Radix
+2  A: 

I believe that the window resize commands are built in to window.el, from emacswiki the functions you want documented are:

shrink-window-horizontally  ; C-x {
enlarge-window-horizontally ; C-x }
enlarge-window              ; C-x ^
shrink-window               ; not bound on my system

The comments are what they are bound to on my system, but I don't know if I did that myself.

All of them take a prefix argument, the number of lines to enlarge/shrink. The last two default to vertical.

quodlibetor
Ja not looking to resize, but to rearrange
MDCore
Oh sorry, misread the question.
quodlibetor
+1  A: 

FWIW, if you are running within a GUI, then you can precisely re-arrange window sizes quickly and easily with the mouse. This isn't quite the same thing as you're asking for, but may be a handy alternative in some cases.

You can click on any non-'active' area of the mode line (such as the buffer name) and then drag it up or down.

Dragging side to side is more fiddly. You must click on the exact border between the two mode lines, and then you can drag left/right.

For your specific example, I don't believe that is supported. AFAIK you can only reorganise the window splits within their existing 'parent' window (the upper split in this example). To make the upper-right window fill the vertical space you would either remove the bottom window with C-x 0, or use C-x 1 to remove all other windows, and then re-split them in the desired manner.

(Tangentially, I've often thought a custom library to 'rotate' the window splits would be a nice thing to have.)

phils
That custom library is exactly what I'm looking for!
MDCore