Questions tagged [hydra]

for questions related to the use of the `hydra.el` package providing short keybindings for sequences of related commands

The hydra.el package is available from https://github.com/abo-abo/hydra . It provides mechanisms for setting up keybindings so that for example one can type C-c jjkk3j5k instead of C-c j C-c j C-c k C-c k M-3 C-c j M-5 C-c k. Use this tag for questions about usage and customization of such hydras.

23 questions
5
votes
1 answer

Use hydra with evil motions

I'm trying to use a hydra to dispatch among a selection of motions. See this minimal example: (defhydra hydra/test (:color blue) "This is a test hydra" ("n" evil-next-line)) (evil-define-motion hydra/test/motion-proxy (&rest args) …
PythonNut
  • 10,243
  • 2
  • 29
  • 75
4
votes
1 answer

Make hints appear immedietly when using Hydra

I use Hydra, and find it very useful. However, I often find that I can only remember the key to trigger the hydra itself, but can't remember which keys are used for the "heads". Luckily, Hydra will give me a nicely formatted list of the keys and…
elethan
  • 4,755
  • 3
  • 29
  • 56
4
votes
1 answer

Why does this function work with :post but not :pre?

(defhydra windows (global-map "C-c w" :post flash-active-buffer) "window moving" ("o" other-window "other")) (make-face 'flash-active-buffer-face) (set-face-attribute 'flash-active-buffer-face nil :background "red" …
Sean Allred
  • 6,861
  • 16
  • 85
3
votes
2 answers

How to select a rotating Hydra option?

From SPC f f (counsel-find-file) minibuffer, open Hydra with C-o (hydra-ivy/body). This is what hydra looks on my system: The Hydra right column has "[m] matcher: order". Pressing 'm' rotates matcher between "other" and "ivy". How to active "other"…
wolfv
  • 1,403
  • 1
  • 13
  • 30
3
votes
1 answer

Little help with a hydra

I need a hydra with four "heads", each of should exit the hydra when its function is executed. The hydra intended to be used in dired-mode and direx:direx-mode and pop-up when O pressed. This is what I got so far: (defhydra dired-open…
iLemming
  • 1,223
  • 9
  • 14
2
votes
2 answers

How to properly define hydras inside use-package?

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…
Florian
  • 241
  • 1
  • 11
2
votes
2 answers

advice on easy formating of hydra docstring

so i used to use the auto generation of hydra hints with the :hint nil and :column 3 argument i recently find a need to have better control on whats presented in the hint area of some huge hydras i have so im trying to edit and write my own hints.…
zeltak
  • 1,685
  • 11
  • 25
2
votes
1 answer

How can i make toggle shortcuts like org mode or magit

I am writing an elisp package currently I am using hydra, I would like to be able to have shortcuts you can toggle on and off for various flags. You see this sort of thing in magit and org mode when you press the key and it hightlight the text…
Oly
  • 583
  • 1
  • 5
  • 15
2
votes
1 answer

How to open a given directory in Dired?

I want to use hydra (in Emacs 24.5.1 on Windows 10) to create a pop-up list of directories that I often use. Selecting one of the directories in the list, using a single key, should cause it to open in Dired. For example, the plan is that once the…
SlowLearner
  • 245
  • 2
  • 6
1
vote
2 answers

Using hydra to split windows like in doom-emacs and Spacemacs

I am writing my own Emacs config coming from doom-emacs and Spacemacs. One thing I really miss is the ability to split windows using split-window-below and split-window-right using S-w s s and S-w s v. I am trying to add this to my config and saw…
page290
  • 11
  • 1
1
vote
1 answer

How to check if a hydra is displaying?

If a hydra is opened, how do we check programmatically that it is actually open and displaying?
zcaudate
  • 637
  • 4
  • 14
1
vote
1 answer

How do you handle a key sequence inside a function?

I want to run a function and do different actions based on the next key sequence. I have this. (defun ask-for-C-b-or-M-b (key-sequence) (interactive "KPress Key") (cond ((seq-set-equal-p key-sequence [?\C-b]) "C-b…
KhalfaniW
  • 337
  • 4
  • 8
1
vote
0 answers

ivy-hydra: error upon C-o

While trying to figure out another problem. I was advised to use the ivy-hydra package. By default, it appears that ivy-hydra is NOT included with prelude-ivy. So I did a package-install ret ivy-hydra. That seemed to install it, but then when I do…
Angelo
  • 271
  • 2
  • 9
1
vote
2 answers

Returning to the parent hydra

I'm looking for a way to return to the parent hydra after using certain commands. In this example (defhydra hydra-a (:color teal) "a" ("b" (progn (hydra-b/body) (hydra-push '(hydra-a/body))) "visit hydra-b") ("q"…
bertfred
  • 1,699
  • 1
  • 11
  • 23
0
votes
1 answer

Is it possible to run a helm or other completion command for hydra window?

Spacemacs offers many hydra window to show various keys. (And my question is not specific to spacemacs, just hydra in general) Sometimes there are many commands so it's hard to find what's there. Is it possible to grep on those key descriptions in…
eugene
  • 481
  • 1
  • 5
  • 11
1
2