Emacs: Save Split Windows Configuration
Emacs can have arbitrary Split Windows panes, and many emacs commands generate content that automatically split window and placed new content into a existing pane. Here's ways to restore your split windows configuration.
Save Split-window Config for Current Session
winner-mode lets you restore to a previous pane configuration. (in emacs 23.2 (released 2010-05))
winner-modeto turn it on.
- Now, remove all split panes by Alt+x
- Now, you can go back to previous split pane config by Alt+x
winner-undo【Ctrl+c ←】. There's also
If you want this functionality always, put this in your Emacs Init File:
;; restore split pane config, winner-undo, winner-redo (winner-mode 1) ;
Using Register to Save Split Windows Config
You can save windows config to register, like this:
window-configuration-to-register【Ctrl+x r w】 (then give it a letter or digit as name).
jump-to-register【Ctrl+x r j】 to restore a previously saved configuration.
Note: register content is not saved when you quit emacs, even if you have
Save Split-window Config Across Sessions
In Emacs 24.4 (released 2014-10) or later, if you restart emacs, previous session's windows and split-panes are automatically restored.
This is because
desktop-save-mode is on by default. [see Emacs Init: Restore Opened Files (desktop-save-mode)]
John D Cook