Emacs: Split Windows

By Xah Lee. Date: . Last updated: .

Emacs Split Window Commands:

split-window-belowCtrl+x 2
Split current pane in 2, one top and one bottom.
split-window-rightCtrl+x 3
Split side-by-side.
delete-other-windowsCtrl+x 1
Unsplit all.
delete-windowCtrl+x 0
Remove current pane.
other-windowCtrl+x o
Move cursor to next pane.
emacs split windows 2022-10-03 PKp57
emacs split windows 2022-10-03 PKp57

Note, emacs terminology of window/frame is reversed from modern meaning.

Adjust Split Pane Size

Or, you can use keys. Here's the commands:

enlarge-windowCtrl+x ^
Increase height.
Decrease height.
enlarge-window-horizontallyCtrl+x }
Increase width.
shrink-window-horizontallyCtrl+x {
Decrease width.
shrink-window-if-larger-than-bufferCtrl+x -
Shrink a window to fit its content.
balance-windowsCtrl+x +
Make all panes same width/height.

Most of these commands also take a argument. universal-argumentCtrl+u】 first then type a number, then, call the command that adjust window size.

Split Window