27

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?

3 Answers 3

47

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.
8

There is delete-window which is binded to C-x 0 by default.

7

You can do Ctrl-x 0 to close current window, which is the default binding for delete-window

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.