Emacs: Split Window

By Xah Lee. Date: . Last updated: .

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

mode line split point 2024-06-23
mode line split point 2024-06-23

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

enlarge-windowCtrl+x ^
Increase height.
shrink-window
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. [see Emacs: Universal Argument (prefix arg)]

emacs, split windows