Add doom/window-enlargen (replace C-w o bind)
This commit is contained in:
parent
34d1364c5b
commit
6eb5f1c8d1
2 changed files with 22 additions and 1 deletions
|
@ -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)))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue