[Hydra] Move custom hydras to ‘use-package’ declaration
This commit is contained in:
parent
e459d534bf
commit
7d8abe0e50
75
init.el
75
init.el
|
@ -568,50 +568,55 @@
|
|||
|
||||
(use-package db-emacsclient)
|
||||
|
||||
(use-package hydra)
|
||||
(use-package hydra
|
||||
:commands (defhydra
|
||||
hydra-toggle/body
|
||||
hydra-zoom/body
|
||||
hydra-rectangle/body)
|
||||
:config
|
||||
|
||||
(defhydra hydra-toggle (:color blue)
|
||||
"toggle"
|
||||
("c" column-number-mode "column")
|
||||
("d" toggle-debug-on-error "debug-on-error")
|
||||
("e" toggle-debug-on-error "debug-on-error")
|
||||
("f" auto-fill-mode "auto-fill")
|
||||
("l" toggle-truncate-lines "truncate lines")
|
||||
("q" toggle-debug-on-quit "debug-on-quit")
|
||||
("r" read-only-mode "read-only"))
|
||||
(defhydra hydra-toggle (:color blue)
|
||||
"toggle"
|
||||
("c" column-number-mode "column")
|
||||
("d" toggle-debug-on-error "debug-on-error")
|
||||
("e" toggle-debug-on-error "debug-on-error")
|
||||
("f" auto-fill-mode "auto-fill")
|
||||
("l" toggle-truncate-lines "truncate lines")
|
||||
("q" toggle-debug-on-quit "debug-on-quit")
|
||||
("r" read-only-mode "read-only"))
|
||||
|
||||
;; zooming with single keystrokes (from oremacs)
|
||||
(defhydra hydra-zoom (:color red)
|
||||
"zoom"
|
||||
("g" text-scale-increase "increase")
|
||||
("l" text-scale-decrease "decrease"))
|
||||
;; zooming with single keystrokes (from oremacs)
|
||||
(defhydra hydra-zoom (:color red)
|
||||
"zoom"
|
||||
("g" text-scale-increase "increase")
|
||||
("l" text-scale-decrease "decrease"))
|
||||
|
||||
;; rectangle mode
|
||||
(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
|
||||
:color pink
|
||||
:post (deactivate-mark))
|
||||
"
|
||||
;; rectangle mode
|
||||
(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
|
||||
:color pink
|
||||
:post (deactivate-mark))
|
||||
"
|
||||
^_k_^ _d_elete _s_tring
|
||||
_h_ _l_ _o_k _y_ank
|
||||
^_j_^ _n_ew-copy _r_eset
|
||||
^^^^ _e_xchange _u_ndo
|
||||
^^^^ ^ ^ _p_aste
|
||||
"
|
||||
("h" backward-char nil)
|
||||
("l" forward-char nil)
|
||||
("k" previous-line nil)
|
||||
("j" next-line nil)
|
||||
("n" copy-rectangle-as-kill nil)
|
||||
("d" delete-rectangle nil)
|
||||
("r" (if (region-active-p)
|
||||
(deactivate-mark)
|
||||
(rectangle-mark-mode 1))
|
||||
nil)
|
||||
("y" yank-rectangle nil)
|
||||
("u" undo nil)
|
||||
("s" string-rectangle nil)
|
||||
("p" kill-rectangle nil)
|
||||
("o" nil nil))
|
||||
("h" backward-char nil)
|
||||
("l" forward-char nil)
|
||||
("k" previous-line nil)
|
||||
("j" next-line nil)
|
||||
("n" copy-rectangle-as-kill nil)
|
||||
("d" delete-rectangle nil)
|
||||
("r" (if (region-active-p)
|
||||
(deactivate-mark)
|
||||
(rectangle-mark-mode 1))
|
||||
nil)
|
||||
("y" yank-rectangle nil)
|
||||
("u" undo nil)
|
||||
("s" string-rectangle nil)
|
||||
("p" kill-rectangle nil)
|
||||
("o" nil nil)))
|
||||
|
||||
(use-package magit
|
||||
:commands (magit-status)
|
||||
|
|
Loading…
Reference in New Issue