2011-08-09

Emacs: “winner-mode”: Preserve Your Split-Panes Configulation

Discovered winner-mode minor mode. It's bundled with emacs 23.2. winner-mode lets you revert to a previous pane configuration.

Example use:

  • Start winner-mode. 【Alt+x winner-mode】.
  • Call split-window-vertically.
  • Call split-window-horizontally.
  • Now, remove all split panes by calling delete-other-windows.
  • Now, you can go back to previous split pane config by typing 【Ctrl+c 】 (winner-undo). With right arrow does winner-redo.

If you want this functionality always, put in your emacs init file:

;; a feature to preserve split pane configuration. Use 【Ctrl+c ←】 and 【Ctrl+c →】
(when (fboundp 'winner-mode) (winner-mode 1)) ; 1 for on, 0 for off