-
-
Notifications
You must be signed in to change notification settings - Fork 113
Verbosity
Oleh Krehel edited this page Aug 2, 2019
·
1 revision
Take this example:
(defhydra hydra-toggle (:columns 2 :exit t)
"toggle:"
("a" abbrev-mode "abbrev")
("d" toggle-debug-on-error "debug")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "quit"))
(global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
Suppose you don't want to see the hint right away, since you remember most of the bindings.
Add :idle 2
to wait 2 seconds before showing the hint:
(defhydra hydra-toggle (:columns 2 :exit t :idle 2)
"toggle:"
("a" abbrev-mode "abbrev")
("d" toggle-debug-on-error "debug")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "quit"))
Set :verbosity 0
to hide the hydra completely, and have a head that sets :verbosity 1
:
(defhydra hydra-toggle (:columns 2 :exit t)
"toggle:"
("a" abbrev-mode "abbrev")
("d" toggle-debug-on-error "debug")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "quit")
("h" (hydra-set-property 'hydra-toggle :verbosity 1) :exit nil))
(global-set-key
(kbd "C-c C-v")
(lambda ()
(interactive)
(hydra-set-property 'hydra-toggle :verbosity 0)
(hydra-toggle/body)))
- Binding-Styles
- Basics
- Verbosity
- Verbosity-Long-Short
- Conditional-Hydra
- defcustom
- Hydra-Colors
- internals
- Nesting-Hydras
- Prefix-map