mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
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:
@ -180,6 +180,14 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.")
|
|||||||
(+ (if (boundp 'display-line-numbers) 6 0)
|
(+ (if (boundp 'display-line-numbers) 6 0)
|
||||||
fill-column))
|
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
|
;; Built-in packages
|
||||||
|
Reference in New Issue
Block a user