diff --git a/core/autoload/ui.el b/core/autoload/ui.el index a0b509f68..3279d28a4 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -15,6 +15,12 @@ (interactive "P") (linum-mode (or arg (if linum-mode -1 +1)))) +;;;###autoload +(defun doom-resize-window (new-size &optional horizontal) + "Resize a window to NEW-SIZE. If HORIZONTAL, do it width-wise." + (enlarge-window (- new-size (if horizontal (window-width) (window-height))) + horizontal)) + ;;;###autoload (defun doom/window-zoom () "Maximize and isolate the current buffer. Activate again to undo this. If the @@ -25,3 +31,18 @@ window changes before then, the undo expires." (jump-to-register ?_) (window-configuration-to-register ?_) (delete-other-windows))) + +(defvar doom--window-wconf nil) + +;;;###autoload +(defun doom/window-enlargen () + "Enlargen the current window. Activate again to undo." + (interactive) + (setq doom--window-enlargened + (if (and doom--window-enlargened + (assoc ?_ register-alist)) + (ignore (jump-to-register ?_)) + (window-configuration-to-register ?_) + (doom-resize-window (truncate (/ (frame-width) 1.2)) t) + (doom-resize-window (truncate (/ (frame-height) 1.2))) + t))) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index 3fe14d2e5..d3dd2ecce 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -255,7 +255,7 @@ "u" #'winner-undo "C-u" #'winner-undo "C-r" #'winner-redo - "o" #'doom/window-zoom + "o" #'doom/window-enlargen ;; Delete window "c" #'+workspace/close-window-or-workspace "C-C" #'ace-delete-window)