implement which-key keymap based replacements#481
Open
jgrey4296 wants to merge 3 commits intonoctuid:masterfrom
Open
implement which-key keymap based replacements#481jgrey4296 wants to merge 3 commits intonoctuid:masterfrom
jgrey4296 wants to merge 3 commits intonoctuid:masterfrom
Conversation
|
I have a configuration like this: (general-create-definer leader-keys
:states '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(leader-keys
"TAB" '(evil-switch-to-windows-last-buffer :which-key "Last buffer"))It creates a message when i press |
leifhelm
reviewed
Apr 29, 2021
| (replacement (cond ((consp wk) (cdr wk)) | ||
| (t wk))) | ||
| ;; check the map exists, if not, try adding -map to it. (ie: global -> global-map) | ||
| (real-keymap (if (boundp keymap) (symbol-value keymap) (symbol-value (intern (format "%s-map" keymap))))) |
There was a problem hiding this comment.
Suggested change
| (real-keymap (if (boundp keymap) (symbol-value keymap) (symbol-value (intern (format "%s-map" keymap))))) | |
| (real-keymap (general--get-keymap nil keymap nil t))) |
Have a look at general--get-keymap. I found it while browsing general--define-key-dispatch
dramatically speeds up boot time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this replaces the use of which-key-replacement-alist with the newer keymap-based-replacement approach of which-key.
It also enables evil-state based which-key bindings.