Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close only one window in Emacs

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?

like image 256
ntalbs Avatar asked Jul 31 '13 04:07

ntalbs


People also ask

How do I close split screen in Emacs?

There are two options to collaps the split windows: delete-other-windows (Ctrl-x 1) delete-window (Ctrl-x 0)

Can you only have one buffer open in Emacs at a time?

Each Emacs window displays one Emacs buffer at any time. A single buffer may appear in more than one window; if it does, any changes in its text are displayed in all the windows where it appears. But the windows showing the same buffer can show different parts of it, because each window has its own value of point.

How do I open a second window in Emacs?

To open a new frame, select Make New Frame from the Files menu or press C-x 5 2 (for make-frame). Emacs makes a new frame containing the current buffer and puts it on top of the current frame.


1 Answers

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.
like image 160
zw324 Avatar answered Sep 19 '22 02:09

zw324