Go to the first, previous, next, last section, table of contents.

Deleting and Rearranging Windows

C-x 0
Delete the selected window (delete-window). That is a zero.
C-x 1
Delete all windows in the selected frame except the selected window (delete-other-windows).
C-x ^
Make selected window taller (enlarge-window).
C-x }
Make selected window wider (enlarge-window-horizontally).
Drag-Mouse-1
Dragging a window's mode line up or down with Mouse-1 changes window heights.
Mouse-2
Mouse-2 in a window's mode line deletes all other windows in the frame (mouse-delete-other-windows).
Mouse-3
Mouse-3 in a window's mode line deletes that window (mouse-delete-window).

To delete a window, type C-x 0 (delete-window). (That is a zero.) The space occupied by the deleted window is given to an adjacent window (but not the minibuffer window, even if that is active at the time). Once a window is deleted, its attributes are forgotten; only restoring a window configuration can bring it back. Deleting the window has no effect on the buffer it used to display; the buffer continues to exist, and you can select it in any window with C-x b.

C-x 1 (delete-other-windows) is more powerful than C-x 0; it deletes all the windows except the selected one (and the minibuffer); the selected window expands to use the whole frame except for the echo area.

You can also delete a window by clicking on its mode line with Mouse-2, and expand a window to fill its frame by clicking on its mode line with Mouse-3.

The easiest way to adjust window heights is with a mouse. If you press Mouse-1 on a mode line, you can drag that mode line up or down, changing the heights of the windows above and below it.

To readjust the division of space among vertically adjacent windows, use C-x ^ (enlarge-window). It makes the currently selected window get one line bigger, or as many lines as is specified with a numeric argument. With a negative argument, it makes the selected window smaller. C-x } (enlarge-window-horizontally) makes the selected window wider by the specified number of columns. The extra screen space given to a window comes from one of its neighbors, if that is possible. If this makes any window too small, it is deleted and its space is given to an adjacent window. The minimum size is specified by the variables window-min-height and window-min-width.

See section Editing in the Minibuffer, for information about the Resize-Minibuffer mode, which automatically changes the size of the minibuffer window to fit the text in the minibuffer.


Go to the first, previous, next, last section, table of contents.