12

I want to use the function to switch to other window when there are only 2 windows in emacs. I know that the shortcut is C-x o, but I don't know which function that shortcut calls.

How do I determine the mapping between shortcut and function?

Dan
  • 32,584
  • 6
  • 98
  • 168
Daniel Wu
  • 1,711
  • 2
  • 17
  • 26

3 Answers3

22

The describe-key command (C-h k) will tell you what command is bound to a given key sequence. To go the other way and find out what keys (if any) are bound to a command, use where-is (C-h w).

You can list all available key bindings using describe-bindings (C-h b).

As of Emacs 25, you can also use view-lossage (C-h l) to see the recent history of every key typed and the corresponding commands that were executed.

You'll notice these commands are all bound to the help map (C-h). You might want to try C-h C-h to see all the available help commands.

glucas
  • 20,175
  • 1
  • 51
  • 83
1

Just got it, I could use the function describe-bindings.

Drew
  • 75,699
  • 9
  • 109
  • 225
Daniel Wu
  • 1,711
  • 2
  • 17
  • 26
0

If you use helm, you can try helm-descbinds. It's pretty convenient, when you want to define your own bindings instead of using the preconfigured shortcuts.

bertfred
  • 1,699
  • 1
  • 11
  • 23