[Feature reques] Major mode specific shortcuts
Closed this issue · 3 comments
I would like to be able to create shortcuts that are only available in certain major modes.
For example, I would like to create shortcuts for org-mode that are only available when org-mode is active.
I tried using :keymap
and :major
but without success.
I am not sure if there is something available that does this or if there isn't.
Example code:
(my-leader-key
:keymap 'org-mode-map
"o" '(:ignore t :which-key "org mode")
"ot" 'org-todo
"oa" '(:ignore t :which-key "org agenda")))
The o prefix should only be available if org-mode is active. When I leave the major mode, the shortcuts are made unavailable.
The correct keyword is :keymaps
. Let me know if you still have any issues after making that change.
Thanks, that did it.
But I must ask, what is the purpose of :keyword
? I looked through the documentation and it was not clear to me what either of them did exactly.
Keyword arguments allow specifying arguments in any order or not at all. I'm not sure if that's what you are asking. When you say "either of them" what do you mean?