Omit undefined/disable keybinds in which-key
This is for commands in disabled modules. This does not disable their keybinds, but it stops them from showing up in which-key.
This commit is contained in:
parent
1ed8894826
commit
d8fa5f39ad
1 changed files with 8 additions and 0 deletions
|
@ -180,6 +180,14 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.")
|
|||
(+ (if (boundp 'display-line-numbers) 6 0)
|
||||
fill-column))
|
||||
|
||||
(defun doom*hide-undefined-which-key-binds (bindings)
|
||||
(cl-loop for bind in bindings
|
||||
if (or (member (cdr bind) '("Prefix Command" "??"))
|
||||
(fboundp (intern (cdr bind))))
|
||||
collect bind))
|
||||
(advice-add #'which-key--get-current-bindings :filter-return #'doom*hide-undefined-which-key-binds)
|
||||
(advice-add #'which-key--get-keymap-bindings :filter-return #'doom*hide-undefined-which-key-binds)
|
||||
|
||||
|
||||
;;
|
||||
;; Built-in packages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue