Skip to content

Instantly share code, notes, and snippets.

@hamsolodev
Created August 19, 2012 09:25
Show Gist options
  • Save hamsolodev/3393945 to your computer and use it in GitHub Desktop.
Save hamsolodev/3393945 to your computer and use it in GitHub Desktop.
;; 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)
(set-fringe-style (cons 3 0)))
(progn
(jump-to-register ?u)
(set-fringe-style 0))))))
(define-key global-map (kbd "s-\\") 'toggle-windows-split)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment