Close only one window in Emacs

emacskeyboard shortcuts

In vim, buffer can be split horizontally or vertically by :sp or :vsp. And a buffer can be closed by :q.

Likewise in emacs, window can be split horizontally by C-x 2, and vertically by C-x 3.
And close all other window by C-x 1.

But, how can I close only one window, like :q in vim?

Best Answer

Try C-x 0, delete-window. This is what C-h k describes:

(delete-window &optional WINDOW)

Remove WINDOW from its frame.
WINDOW defaults to the selected window.  Return nil.
Signal an error when WINDOW is the only window on its frame.
Related Topic