7

I can use C-h c (describe-key-briefly) and type a key combination and it will return me the function bound to it. But I'd also like to type only a prefix of a key combination and have it list and describe all functions bound to key sequences starting with it, like "all bound keys starting with C-x".

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
agentofuser
  • 8,987
  • 11
  • 54
  • 85

2 Answers2

17

Do the key combo then C-h. For your example of C-x, do C-x C-h. This also works with sub-maps, e.g. C-x r C-h to see everything under C-x r

scottfrazer
  • 17,079
  • 4
  • 51
  • 49
  • Awesome, I never knew this. Not at all obvious, though. Almost nothing in emacs is obvious. – Drew Hoskins Aug 15 '09 at 17:15
  • Yeah, the section of the manual that describes this in detail is not very obvious. Reading, what a waste of time! – jrockway Aug 16 '09 at 12:34
  • You can also use `F1` instead of `C-h` (and indeed there's an instance where you can only use `F1` -- [see duplicate question](http://stackoverflow.com/questions/10330510/show-emacs-keybindings-which-start-with-a-particular-key)) – phils Jan 29 '13 at 16:47
1

It is also not the case that every prefix key works this way (follow it with C-h to see the bindings).

Here are two additional resources that can help:

  • Command describe-keymap, in help-fns+.el. But to use it you need to have the keymap available (e.g. as the value of a variable, such as ctl-x-map). Unlike just using C-h v on a keymap variable, the output is human readable.

  • Icicles key completion. Just type the prefix key, then hit S-TAB. Buffer *Completions* shows you all possible completions: the keys plus their associated commands (or ... if they are themselves prefix keys). For multiple-level prefix keys (e.g. C-x r) the candidates include prefix keys (e.g. prefix key r to partially complete prefix key C-x). You can navigate up and down the keymap hierarchy this way. And you can cycle among candidates and hit C-M-RET on any to see their complete help.

Drew
  • 29,895
  • 7
  • 74
  • 104