4

Linux Mint 20

Emacs 27.2

ido-mode

When I press M-x then show (ido-mode) the list of functions.

List of functions

Nice. But sometime it is not enough. I need to know what is keybinding for this functions. Is it possible to show keybining when press M-x ?

6
  • I don't know if this is possible with ido. helm does this, but helm is a really big package with lots of features beyond ido.
    – Tyler
    Commented May 4, 2021 at 20:22
  • 1
    Icicles shows you key bindings next to the command names in *Completions*. Vanilla Emacs doesn't do that, as far as I know. But as @db48x's answer says, you can always stop and use C-h f to find out what a command is bound to.
    – Drew
    Commented May 4, 2021 at 23:02
  • ivy/counsel/swiper does this too. Commented May 11, 2021 at 20:34
  • Plain M-x in Emacs 28 does this by default too.
    – Basil
    Commented Jun 3, 2021 at 22:38
  • 1
    @a_subscriber I'm referring to the current development version of Emacs, that will be officially released in the future as Emacs 28. You can see the current list of upcoming features and changes here: git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS. For the feature in question, search for suggest-key-bindings.
    – Basil
    Commented Jun 4, 2021 at 8:40

2 Answers 2

1

The amx package will provide this:

Showing keyboard shortcuts for commands

When completing command names, Amx shows the keyboard shortcut for all commands currently bound to a key, so you can find out when there's an easier way to run the command you're looking for.

Ie, M-x find-file may appear similar to this, depending on themes and other packages:

enter image description here

0

You can use C-h f to get all the help about any function, including what keys it is bound to.

1
  • I know about C-h f, but I want interactively show keybinding Commented May 5, 2021 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.