30

我读过这个,但我的问题是不同的。我想知道如何在 Emacs 中查看以特定键开头的键绑定。我想绑定f2,但想知道它当前绑定的是什么。按键序列的按下C-h m提示。进入f2这里导致 Emacs 等待我完成链,因为f2单独什么都不做。如何查看所有以开头的键绑定f2

4

1 回答 1

48

F2F1 or F2C-h

In general, typing F1 or C-h after any prefix-binding will list all the bindings using that prefix:

describe-prefix-bindings is an interactive compiled Lisp function in help.el.

Describe the bindings of the prefix used to reach this command. The prefix described consists of all but the last event of the key sequence that ran this command.

F1 is the more reliable of the two (but only very slightly so), as detailed by the following documentation excerpts.

M-: (info "(emacs) Misc Help") RET:

You can get a list of subcommands for a particular prefix key by typing C-h (describe-prefix-bindings) after the prefix key. (There are a few prefix keys for which this does not work--those that provide their own bindings for C-h. One of these is <ESC>, because <ESC> C-h is actually C-M-h, which marks a defun.)

M-: (info "(emacs) Keys") RET:

Typing the help character (C-h or <F1>) after a prefix key displays a list of the commands starting with that prefix. The sole exception to this rule is <ESC>: <ESC> C-h is equivalent to C-M-h, which does something else entirely. You can, however, use <F1> to display a list of commands starting with <ESC>.

M-: (info "(emacs) Help") RET:

C-h or <F1> means "help" in various other contexts as well. For instance, you can type them after a prefix key to view a list of the keys that can follow the prefix key. (A few prefix keys don't support C-h in this way, because they define other meanings for it, but they all support <F1> for help.)

M-: (info "(elisp) Key Binding Conventions") RET:

Don't bind C-h following any prefix character (including C-c).
If you don't bind C-h, it is automatically available as a help character for listing the subcommands of the prefix character.

于 2012-04-26T09:20:38.430 回答