Skip to content
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.

Method 1:

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"))

Method 2:

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)))
Clone this wiki locally