Created
August 18, 2012 00:20
-
-
Save quux00/3383607 to your computer and use it in GitHub Desktop.
Emacs: toggle between split windows and a single window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Toggle between split windows and a single window | |
(defun toggle-windows-split() | |
"Switch back and forth between one window and whatever split of windows we might have in the frame. The idea is to maximize the current buffer, while being able to go back to the previous split of windows in the frame simply by calling this command again." | |
(interactive) | |
(if (not (window-minibuffer-p (selected-window))) | |
(progn | |
(if (< 1 (count-windows)) | |
(progn | |
(window-configuration-to-register ?u) | |
(delete-other-windows)) | |
(jump-to-register ?u)))) | |
(my-iswitchb-close)) | |
(define-key global-map (kbd "C-|") 'toggle-windows-split) | |
;; Note: you may also need to define the my-iswitchb-close function | |
;; created by Ignacio as well: http://emacswiki.org/emacs/IgnacioPazPosse | |
(defun my-iswitchb-close() | |
"Open iswitchb or, if in minibuffer go to next match. Handy way to cycle through the ring." | |
(interactive) | |
(if (window-minibuffer-p (selected-window)) | |
(keyboard-escape-quit))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my-iswitchb-close is not defined. It should be defined or omitted. Thanks for the code!