Skip to content

Instantly share code, notes, and snippets.

@shanff
Forked from mads-hartmann/toggle-maximize-buffer.el
Created November 9, 2020 04:12
Show Gist options
  • Select an option

  • Save shanff/c2bae7b6bb35894ecec6e2e01862757f to your computer and use it in GitHub Desktop.

Select an option

Save shanff/c2bae7b6bb35894ecec6e2e01862757f to your computer and use it in GitHub Desktop.
An Emacs function to temporarily make one buffer fullscreen. You can quickly restore the old window setup.
(defun toggle-maximize-buffer () "Maximize buffer"
(interactive)
(if (= 1 (length (window-list)))
(jump-to-register '_)
(progn
(set-register '_ (list (current-window-configuration)))
(delete-other-windows))))
;; Bind it to a key.
;; (global-set-key [(super shift return)] 'toggle-maximize-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment