From a46829a06ce10d1f5754678ce4d1422cfa304be6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 19 Feb 2017 18:11:44 -0500 Subject: [PATCH] Add doom/window-zoom to core/autoload/ui --- core/autoload/ui.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/autoload/ui.el b/core/autoload/ui.el index 30dafa580..5e257de94 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -25,3 +25,17 @@ (mapc 'disable-theme custom-enabled-themes)) (load-theme theme t))) +;;;###autoload +(defun doom/window-zoom () + "Maximize and isolate the current buffer. Activate again to undo this. If the +window changes before then, the undo expires." + (interactive) + (unless (one-window-p) + (setq doom-window-zoomed nil)) + (if doom-window-zoomed + (progn + (set-window-configuration doom-window-zoomed) + (setq doom-window-zoomed nil)) + (unless (one-window-p t) + (setq doom-window-zoomed (current-window-configuration)) + (delete-other-windows))))