Kungsgeten / ryo-modal

Roll your own modal mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I trigger a Ryo Hydra?

shadowrylander opened this issue · comments

Hello!

New to Emacs, so I apologize for what may seem like a ridiculous question; however, in a situation such as your Hydra for Git! mode... how would you exit to "insert" mode again? 😅

Thank you kindly for the help, and looking forward to using this incredible package (with Hydra 😹)!

Actually, if I may change the issue (should I create a new one?): I set up your example of A Hydra for Git!, for org-mode, but while I can toggle ryo on and off, the hydra doesn't seem to work. How would I go about triggering it?

This is the code:

(ryo-modal-key
    "SPC o" :hydra
    '(hydra-org ()
             "A hydra for org-mode!"
             ("o" org-babel-tangle "tangle" :color color-208)
             ("f" org-babel-tangle-file "tangle file" :color color-202)
             ("q" nil "cancel" :color red)))

And this how I installed ryo:

(use-package ryo-modal
    :straight (:host github :repo "kungsgeten/ryo-modal"
        :branch "master"))

In case it matters, I'm using chemacs2 with Doom Emacs on top of Emacs-Nox.

Hi! I'm not 100% sure I understand the question, but regarding how to exit a Hydra, check the documentation of the hydra package. One way is to use :color blue on a command (instead of :color red above). Then you'll exit the Hydra, but ryo-modal-mode will still be active. If you want to exit the hydra and deactivate ryo-modal-mode you could simply call the ryo-modal-mode command with :color blue, like this:

(ryo-modal-key
 "SPC o" :hydra
 '(hydra-org ()
             "A hydra for org-mode!"
             ("o" org-babel-tangle "tangle")
             ("f" org-babel-tangle-file "tangle file")
             ("q" ryo-modal-mode "cancel" :color blue)))

Here's some information on colors in Hydras: https://github.com/abo-abo/hydra#color

Ah, got it; thanks! Unfortunately, I'm still not seeing the menu itself when pressing SPC o in ryo-modal-mode (accessed via M-x). Am I missing something in the code, or perhaps my emacs configuration?

Whoops; didn't mean to do that. Those two buttons really shouldn't be so close together.

It could be that Space is already used for something else and that Emacs doesn't want to use it as a prefix key. Try binding it to something else and see if it works. It could also be that you're using an old version om ryo-modal, perhaps from MELPA Stable instead of regular MELPA?

Ah, yes; SPC o is already is being used. I was hoping ryo would override that in the ryo-modal-mode; is there any way to do that?

Also, I'm using the master branch of ryo, as stated here:

(use-package ryo-modal
    :straight (:host github :repo "kungsgeten/ryo-modal"
        :branch "master"))

Not again...

Also, I changed the keybinding to SPC j, as that seems to be free, but I get the message that said keybinding is undefined, both in ryo-modal-mode and not.

I believe I solved the original issue somehow; thanks for all the help!