Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I rearrange a split pane in Emacs?

Tags:

emacs

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.

like image 336
MDCore Avatar asked Oct 01 '10 12:10

MDCore


People also ask

How do I move windows in Emacs?

With the keyboard, you can switch windows by typing C-x o ( other-window ). That is an o , for `other', not a zero. When there are more than two windows, this command moves through all the windows in a cyclic order, generally top to bottom and left to right.

How do I split a window vertically in Emacs?

Splitting WindowsThe command C-x 2 ( split-window-vertically ) breaks the selected window into two windows, one above the other. Both windows start out displaying the same buffer, with the same value of point.

How do I resize a window in Emacs?

Type C-c + to enlarge the window. Then hit + or - repeatedly to enlarge/shrink the window. Any other key ends the resize operation.

How do I get rid of split screen in Emacs?

Use the C-x b command or the Buffers menu. Or if you haven't opened the file, yet, use the C-x C-f command to open the new file in a new buffer. To unsplit the window, use the command C-x 1 or right-click on either title bar.


2 Answers

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.

like image 100
quodlibetor Avatar answered Oct 11 '22 14:10

quodlibetor


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.

like image 23
Jérôme Radix Avatar answered Oct 11 '22 12:10

Jérôme Radix