New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ivy.el: hydra-style action prompt #469
Conversation
Add a custom variable `ivy-action-display-style' to optionally toggle the use of a hydra-style docstring as hint in the `ivy-read-action' minibuffer prompt. Add a variable `ivy--action-hints-lists' and a command `ivy-set-action-hint' to customize this string globally or per command. This gives some flexibility to arrange the layout of the action prompt, which can be useful especially for commands with a large number of actions. Add a function `ivy-hydra--make-action-hint' which is called by `ivy-read-action' to build the docstring when `ivy-action-display-style' is set to 'hydra. This function is defined in ivy-hydra.el since it depends on the hydra package, and is autoloaded in ivy.el.
Looks to me like a whole lot of complexity to customize a face. Or am I missing something? |
Sorry, I think I was not clear. My purpose is not to change the font of the action key, it is be able to structure the layout of the actinos. For instance I have a But you may be right that it is too complex for a small benefit. For the record, another possibility (this is what I first did) is to have a full-blown that not only generates the hint but also runs |
I can just make this into a lambda:
And let the user override it. Would that work for you? |
Yes that would of course work for me by overriding the lambda. Thanks a lot. |
Have a look, hope it works for you. |
Yes it works perfectly, thank you! |
In case you find it useful (it is useful to me for ivy-read commands with many actions).
There is really just one commit, I probably did something wrong to end up with two identical ones. Let me know if you need me to make changes.
ivy-action-display-style
to optionally togglethe use of a
hydra
-style docstring as hint in theivy-read-action
minibuffer prompt.
ivy--action-hints-lists
and a commandivy-set-action-hint
to customize this string globally orper command. This gives some flexibility to arrange the layout of the
action prompt, which can be useful especially for commands with a large
number of actions.
ivy-hydra--make-action-hint
which is called byivy-read-action
to build the docstring whenivy-action-display-style
is set to
'hydra
. This function is defined inivy-hydra.el
since itdepends on the
hydra
package, and is autoloaded in ivy.el.