Skip to content

Commit

Permalink
增加amx的key binding的高亮
Browse files Browse the repository at this point in the history
  • Loading branch information
georgealbert committed Sep 27, 2020
1 parent ccfc92c commit bfb5a56
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions amx.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ If nil, a `amx-update' is needed ASAP.")
:group 'convenience
:link '(emacs-library-link :tag "Lisp File" "amx.el"))

(defface helm-M-x-key '((t (:foreground "orange" :underline t)))
"Face used in helm-M-x to show keybinding."
:group 'helm-command-faces)

;;;###autoload
(define-minor-mode amx-mode
;; TODO Update all references to ido
Expand Down Expand Up @@ -622,7 +626,7 @@ May not work for things like ido and ivy."
:initial-input initial-input
:test predicate
:default def
:name "Helm M-x Completions"
:name "Helm M-x Completions - amx"
:buffer "Helm M-x Completions"
:history extended-command-history
:reverse-history t
Expand Down Expand Up @@ -1080,7 +1084,9 @@ found for COMMAND, the command's name is returned alone."
(cmdsym (intern cmdname))
(keybind (and bind-hash (gethash cmdsym bind-hash))))
(if (and keybind (not (amx-command-ignored-p cmdsym)))
(format "%s (%s)" cmdname keybind)
(format "%s (%s)" cmdname (propertize
keybind
'face 'helm-M-x-key))
cmdname)))

(defun amx-augment-commands-with-keybinds
Expand Down

0 comments on commit bfb5a56

Please sign in to comment.