mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add doom/window-enlargen (replace C-w o bind)
This commit is contained in:
@ -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)))
|
||||
|
Reference in New Issue
Block a user