This is an annoying issue for a long time, at least to me.
Suppose I have split the windows in certain ways. Then I found that it is difficult to view a file in a small windows, then I do C-x 1 to get a better view. But is there any way I can restore my previous window splits?
For example, when using gdb-many-windows (5 windows by default), the source code is shown in middle. I would like to view in big window (single window) then restore my original split setting (5 windows).
Hope I explain things clear.
Thanks
The way to do it programatically in elisp is to use the current-frame-configuration
function to get a list, which you can then use to restore it later.
Thus:
(setq my-window-list (current-frame-configuration))
and later:
(set-frame-configuration my-window-list)
You can easily wrap those in a function to save and load and then bind them to a key binding (possibly overriding c-x 1 so you always save on singe-window-expand).
I often use registers to save/restore window configurations. For instance, to save it in register a
do
C-xrwa
Then, to restore
C-xrja
See http://www.emacswiki.org/emacs/WindowsAndRegisters for more detail.
There are also many other, fancier tools to work with window configurations, like e2wm which is especially useful if you like to use several pre-set window configurations. See also http://www.emacswiki.org/emacs/CategoryWindows#toc4 for some other tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With