如何在 Emacs 中调用缓冲区列表
我通常在 Emacs 中输入 Mx buffer-menu
来切换缓冲区。我怎样才能用更短的命令来做到这一点?输入的字符串相当长。
谢谢!
I usually type M-x buffer-menu
to switch buffers in Emacs. How can I do this with a shorter command? Its quite a long string to type.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用
Cx b
更改缓冲区。你必须输入缓冲区名称的前几个字母,当然你可以使用补全。如果按TAB
(Emacs 中最有用的键),则会出现(匹配的)缓冲区列表。您可以单击此列表来切换到缓冲区。您可以将
buffer-menu
绑定到一个按键。选择一个不用于其他命令的键 - 比如说f12
- 并将以下行添加到文件~/.emacs
中:Emacs 中还有许多其他更改缓冲区的接口,并且它们比
Cx b
效率更高和<代码>Cx Cb。由于这往往是一个非常个人的选择,因此我建议您尝试一些并保留您觉得最舒服的一个。You can use
C-x b
to change buffers. You have to enter the first few letters of the buffer name, and of course you can use completion. If you pressTAB
(the most useful key in Emacs), a list of (matching) buffers appears. You can click in this list to switch to a buffer.You can bind
buffer-menu
to a key. Pick a key that's not used for another command — let's sayf12
— and add the following line to the file~/.emacs
:There are many other interfaces to changing buffers in Emacs, and they can be significantly more efficient than
C-x b
andC-x C-b
. Since this tends to be a very personal choice, I recommend you experiment with a few and keep the one(s) you feel most comfortable with.Cx Cb
如此处所述
C-x C-b
As stated here
我强烈建议切换到专为高效缓冲区切换而设计的模式。
如果您的 Emacs 版本足够新(22+):
然后:
切换缓冲区,使用增量子字符串匹配,
Cs
和Cr
在匹配中向前和向后旋转。如果您有旧版本的 Emacs,它应该具有:
然后,与 ido-mode 一样:
打开迷你缓冲区,让您选择要切换到的缓冲区。
I'd highly recommend switching to a mode designed for efficient buffer switching.
If your version of Emacs is recent enough (22+):
and then:
to switch buffers, with incremental substring matching,
C-s
andC-r
rotate forward and backwards through the matches.If you have an older version of Emacs, it should have:
and then, as with
ido-mode
:opens up the minibuffer to let you choose the buffer to switch to.
将 Cx Cb 绑定到
buffer-menu
。将其绑定到 list-buffers 是没有意义的。list-buffers
只是buffer-menu
的太监版本。 ;-)你可能想尝试这个: http://www.emacswiki.org/emacs/BufferMenuPlus< /a>
Bind C-x C-b to
buffer-menu
. There is no sense leaving it bound tolist-buffers
.list-buffers
is just a eunuch version ofbuffer-menu
. ;-)And you might want to try this: http://www.emacswiki.org/emacs/BufferMenuPlus
尝试 bs-show (我认为比 Cx Cb 更好)。您可以通过将其添加到 .emacs 将其绑定到 F9:
Try bs-show (in my opinion a way better than C-x C-b). You can bind it to F9 by adding this to .emacs: