For example, I use undo-tree
and have the following in my config file:
(use-package undo-tree
:ensure t
:diminish (undo-tree-mode . "")
:config
(global-undo-tree-mode 1))
Now I want to use the hydra taken from the hydra wiki:
(defhydra hydra-undo-tree (:hint nil)
"
_p_: undo _n_: redo _s_: save _l_: load "
("p" undo-tree-undo)
("n" undo-tree-redo)
("s" undo-tree-save-history)
("l" undo-tree-load-history)
("u" undo-tree-visualize "visualize" :color blue)
("q" nil "quit" :color blue))
(global-set-key (kbd "C-x u") 'hydra-undo-tree/undo-tree-undo)`
What would be the proper way to define the hydra inside use-package
and set the keybinding using :bind
?