mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-11-23 06:38:57 +01:00
add dynamic window margin support to window hydra
This commit is contained in:
@@ -176,12 +176,28 @@ _a_ || _d_ |---| _w_ --- _s_ ="
|
|||||||
("s" enlarge-window nil)
|
("s" enlarge-window nil)
|
||||||
("q" nil nil :color red))
|
("q" nil nil :color red))
|
||||||
|
|
||||||
|
;; (set-window-margins nil novel--cur-margin novel--cur-margin)
|
||||||
|
(setq current-window-margin 0)
|
||||||
|
(setq current-window-margin-step 10)
|
||||||
|
|
||||||
|
(defun tvd-window-margin-add()
|
||||||
|
(interactive)
|
||||||
|
(setq current-window-margin (+ current-window-margin current-window-margin-step))
|
||||||
|
(set-window-margins nil current-window-margin current-window-margin))
|
||||||
|
|
||||||
|
(defun tvd-window-margin-sub()
|
||||||
|
(interactive)
|
||||||
|
(setq current-window-margin (- current-window-margin current-window-margin-step))
|
||||||
|
(if (< current-window-margin 0)
|
||||||
|
(setq current-window-margin 0))
|
||||||
|
(set-window-margins nil current-window-margin current-window-margin))
|
||||||
|
|
||||||
(defhydra hydra-windows (:color blue)
|
(defhydra hydra-windows (:color blue)
|
||||||
"
|
"
|
||||||
|
|
||||||
^Window Management^
|
^Window Management^
|
||||||
^^------------------------------------------------------------------------
|
^^------------------------------------------------------------------------
|
||||||
_+_ Increase Font | _-_ Decrease Font Resize ^ ^ _w_ ^ ^
|
_+_: Increase Font | _-_: Decrease Font Resize ^ ^ _w_ ^ ^
|
||||||
_f_: Flip Windows <M-O> ^^ Current _a_ ^ ^ _d_
|
_f_: Flip Windows <M-O> ^^ Current _a_ ^ ^ _d_
|
||||||
_4_: Quarter Windows <C-x 4> ^^ Window: ^ ^ _s_ ^ ^
|
_4_: Quarter Windows <C-x 4> ^^ Window: ^ ^ _s_ ^ ^
|
||||||
_u_: Windows Undo <C-c left>
|
_u_: Windows Undo <C-c left>
|
||||||
@@ -189,7 +205,7 @@ _r_: Windows Redo <C-c right> ^^ _l_: Adjust Background brighter
|
|||||||
_i_: Invert Colors <C-c C-i> ^^ _b_: Adjust Background darker
|
_i_: Invert Colors <C-c C-i> ^^ _b_: Adjust Background darker
|
||||||
|
|
||||||
_h_: Toggle Highlight Line Mode ^^ _e_: Eyebrowse Workspaces (C-x C-x)
|
_h_: Toggle Highlight Line Mode ^^ _e_: Eyebrowse Workspaces (C-x C-x)
|
||||||
_n_: Toogle Line Number Mode
|
_n_: Toogle Line Number Mode ^^ _m_: increase | _M_: decrease margin
|
||||||
|
|
||||||
^^------------------------------------------------------------------------
|
^^------------------------------------------------------------------------
|
||||||
Reach this hydra with <C-x w>
|
Reach this hydra with <C-x w>
|
||||||
@@ -212,6 +228,8 @@ Reach this hydra with <C-x w>
|
|||||||
("e" hydra-eyebrowse/body nil)
|
("e" hydra-eyebrowse/body nil)
|
||||||
("h" hl-line-mode nil)
|
("h" hl-line-mode nil)
|
||||||
("n" linum-mode nil)
|
("n" linum-mode nil)
|
||||||
|
("m" tvd-window-margin-add nil :color pink)
|
||||||
|
("M" tvd-window-margin-sub nil :color pink)
|
||||||
("q" nil nil :color red))
|
("q" nil nil :color red))
|
||||||
|
|
||||||
(global-set-key (kbd "C-x w") 'hydra-windows/body))
|
(global-set-key (kbd "C-x w") 'hydra-windows/body))
|
||||||
|
|||||||
Reference in New Issue
Block a user