简体   繁体   English

如何在Emacs中调用缓冲区列表

[英]How to invoke the buffer list in Emacs

I usually type Mx buffer-menu to switch buffers in Emacs. 我通常输入Mx buffer-menu来切换Emacs中的缓冲区。 How can I do this with a shorter command? 如何使用较短的命令执行此操作? Its quite a long string to type. 它的字符串非常长。

Thanks! 谢谢!

Cx Cb Cx Cb

As stated here 如前所述这里

  • You can use Cx b to change buffers. 您可以使用Cx b来更改缓冲区。 You have to enter the first few letters of the buffer name, and of course you can use completion. 您必须输入缓冲区名称的前几个字母,当然您可以使用完成。 If you press TAB (the most useful key in Emacs), a list of (matching) buffers appears. 如果按TAB (Emacs中最有用的键),将显示(匹配)缓冲区列表。 You can click in this list to switch to a buffer. 您可以单击此列表以切换到缓冲区。

  • You can bind buffer-menu to a key. 您可以将buffer-menu绑定到键。 Pick a key that's not used for another command — let's say f12 — and add the following line to the file ~/.emacs : 选择一个不用于其他命令的f12 - 让我们说f12 - 并将以下行添加到文件~/.emacs

     (global-set-key (kbd "<f12>") 'buffer-menu) 
  • There are many other interfaces to changing buffers in Emacs , and they can be significantly more efficient than Cx b and Cx Cb . 在Emacs中有许多其他更改缓冲区的接口 ,它们可以比Cx bCx Cb更有效。 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. 由于这往往是一个非常个人的选择,我建议你尝试一些,并保持你感觉最舒适的那个。

I'd highly recommend switching to a mode designed for efficient buffer switching. 我强烈建议切换到专为高效缓冲切换而设计的模式。

If your version of Emacs is recent enough (22+): 如果你的Emacs版本足够新(22+):

M-x ido-mode

and then: 接着:

C-x b

to switch buffers, with incremental substring matching, Cs and Cr rotate forward and backwards through the matches. 切换缓冲区,增量子串匹配, CsCr在匹配中向前和向后旋转。

If you have an older version of Emacs, it should have: 如果您有旧版本的Emacs,它应该具有:

M-x iswitchb-mode

and then, as with ido-mode : 然后,与ido-mode

C-x b

opens up the minibuffer to let you choose the buffer to switch to. 打开迷你缓冲区让你选择要切换到的缓冲区。

Bind Cx Cb to buffer-menu . Cx Cb绑定到buffer-menu There is no sense leaving it bound to list-buffers . 将它绑定到list-buffers是没有意义的。 list-buffers is just a eunuch version of buffer-menu . list-buffers只是buffer-menu一个太监版本。 ;-) ;-)

And you might want to try this: http://www.emacswiki.org/emacs/BufferMenuPlus 你可能想尝试这个: http//www.emacswiki.org/emacs/BufferMenuPlus

Try bs-show (in my opinion a way better than Cx Cb). 尝试bs-show(在我看来比Cx Cb更好)。 You can bind it to F9 by adding this to .emacs: 您可以通过将其添加到.emacs将其绑定到F9:

(global-set-key (kbd "<f9>") 'bs-show)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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