conao3 / leaf.el

Flexible, declarative, and modern init.el package configuration
GNU General Public License v3.0
505 stars 28 forks source link

`:bind` on multiple keymaps #529

Open Leirda01 opened 2 years ago

Leirda01 commented 2 years ago

Hello,

Sorry if this issue has already been opened or if the documentation already answers this question. I looked for it on the Internet and throughout the README but I couldn't find anything relevant to my problem.

I want to know if there's a way to do something like, for instance, this:

(leaf vertico
  :bind
  ((evil-normal-state-map evil-visual-state-map
    :package evil
    ("<leader>f" . find-file))
  :init (vertico-mode))

to be able to define bindings for multiple keymaps at once.

I think this should also affects :bind*, :bind-keymap and :bind-keymap*.

There is a passage in the documentation which I struggle to understand about using [remap isearch-forward] as a vector, but from my understanding, it doesn't address this issue.

I'm not sure already about the macro-expand-1 form that would be expected from this, but with a little help I'm willing to propose an implementation for this feature if there's no better way and if there's nothing against this.

conao3 commented 2 years ago

Thanks for suggesting this feature. Your grammar is fine. However, the parsing part of the argument :bind is difficult, so it may be challenging to create a PR, but I am positive about this suggestion.