Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximizing / restoring a window in emacs

Tags:

emacs

lisp

elisp

Ok, so maybe this is more a question for the superuser site but I figured there'd be a hell of a lot more emacs users on stackoverflow.

Basically I often have my emacs split into about 4 windows so I can look at a bunch of buffers at the same time.. however I'd like to be able to C-x 1 (make the window the same size as emacs) and then somehow restore back to my nice 4 window layout I was just looking at.

Is there an easy way to do this or do I need some elisp / lisp (note: I don't know ANY elisp.)

Thanks! John.

like image 860
John Hunt Avatar asked Oct 03 '11 23:10

John Hunt


People also ask

How do I maximize in Emacs?

Now you can force Emacs to start in maximized mode with the command line switch --maximized or -mm . In Windows you have to use a bit of elisp and Win32 magic to get it to work. The code will only execute on Windows, and it works by sending a WM_SYSCOMMAND window message to itself, telling it to maximize.

How do I make Emacs full screen?

Basic settings Now run Emacs and press F11 to switch into full-screen mode. Press F11 again to switch to windowed mode.

How do I open multiple Emacs windows?

You can split a window horizontally or vertically by clicking C-Mouse-2 in the mode line or the scroll bar.

How do I close a buffer window in Emacs?

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 .


1 Answers

Try winner-mode.

With winner-mode enabled, you can restore your previous window configuration with C-c<left>.

You can type it repeatedly to step back through the window configuration history, so you're safe even when there have been multiple intervening changes.

C-c<right> returns you (directly) to the most recent configuration.

like image 66
Asher L. Avatar answered Oct 27 '22 03:10

Asher L.