Emacs:用于命令的打印键绑定或列出所有键绑定 [英] Emacs: print key binding for a command or list all key bindings
问题描述
在Emacs(GNU 23.2,* nix)中,我如何:
In Emacs (GNU 23.2, *nix), how can I:
- 列出绑定到特定命令的键序列?例如,我们如何列出执行
save-buffers-kill-emacs
的所有键序列,键序列的输出与它绑定?假设我们可以这样做,列出绑定到goto-line
的关键序列应该打印输出:Mg g
默认安装。 - 列出所有键绑定?是否执行
C-h b
是否打印自己的绑定?
- list the key sequences bound to a particular command? For example, how can we list all the key sequences that execute
save-buffers-kill-emacs
, with the output of key sequences bound to it? Assuming we can do this, listing the key sequences bound togoto-line
should print the output:M-g g
on a default install. - list all key-bindings? Does
C-h b
do this? Would it print my own bindings?
我知道直接执行命令可以打印可以激活的键序列,但是它并不总是这样做,并且发生一些事情,包括:
(1)输出不会持续很长时间,(2)执行命令。
I am aware that executing the command directly can print a key sequence it can be activated with, but it doesn't always do so, and a few things happen, including:
(1) the output doesn't remain for long, (2) the command is executed.
我想要一个命令,它为我列出(最好是所有)附加到给定命令的绑定,而不执行命令,或类似的东西。
I want a command that lists for me (preferably all) the bindings attached to a given command, without executing the command, or something like that.
推荐答案
-
Chf (或 Mx describe-function < kbd>)将显示一个命令的绑定。
C-h f (or M-x describe-function) will show you the bindings for a command.
你是正确的, Ch b (或 Mx描述-bindings )将显示所有绑定。
You are correct, C-h b (or M-x describe-bindings) will show you all bindings. C-h m (M-x describe-mode) is also handy to list bindings by mode.
$ b $ b
您还可以尝试使用 Ch k ( Mx describe-key )来显示什么命令绑定到一个键。例如,在我的机器上, save-buffers-kill-emacs
不限于任何东西,但是 Ch k Cx Cc 告诉我, > Cx Cc 绑定到 save-buffers-kill-terminal
。它将同时列出该命令的所有绑定。
You might also try C-h k (M-x describe-key) to show what command is bound to a key. For instance, on my machine save-buffers-kill-emacs
isn't bound to anything, but C-h k C-x C-c tells me that C-x C-c is bound to save-buffers-kill-terminal
. It will list all bindings for the command at the same time.
这篇关于Emacs:用于命令的打印键绑定或列出所有键绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!