简体   繁体   中英

How do I get a list of commands starting with a certain key (combo) in Emacs?

I can use Ch 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 Cx ".

Do the key combo then Ch. For your example of Cx, do Cx Ch. This also works with sub-maps, eg Cx r Ch to see everything under Cx r

It is also not the case that every prefix key works this way (follow it with Ch 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 (eg as the value of a variable, such as ctl-x-map ). Unlike just using Ch 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 (eg Cx r ) the candidates include prefix keys (eg prefix key r to partially complete prefix key Cx ). You can navigate up and down the keymap hierarchy this way. And you can cycle among candidates and hit CM-RET on any to see their complete help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM