Emacs ido 以循环列表中第一个打开的缓冲区开始

发布于 2024-12-03 05:01:12 字数 144 浏览 1 评论 0原文

当启用 emacs ido 模式切换缓冲区时,迷你缓冲区中会显示完成列表。似乎有一个“功能”,即已打开的缓冲区被放置到列表的末尾。然而,我经常在多个窗格中打开同一个缓冲区。

有没有办法关闭这个“功能”,或者做相反的事情:让已经打开的缓冲区位于完成列表的前面?

When switching buffers with emacs ido mode enabled, a list of completions are displayed in the minibuffer. It appears there is a "feature" that buffers that are already open are put to the end of the list. I, however, often open the same buffer in multiple panes.

Is there a way to either turn this "feature" off, or alternatively do the opposite: have the buffers that are already open be at the front of the completion list?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅气尐潴 2024-12-10 05:01:12

ido 模式的要点是您不使用箭头在迷你缓冲区中的缓冲区之间导航。相反,您可以键入缓冲区名称的一部分。在这种情况下,缓冲区位于列表中的位置并不重要。

The main point of ido mode is that you don't use arrows to navigate between buffers in the minibuffer. Instead you type the part of the buffer's name. In this case it doesn't matter where the buffer is in the list.

一杯敬自由 2024-12-10 05:01:12

这是不可能的,除非你想深入到ido的肠子里。

正如 eGlyph 已经说过的:您可能错误地使用了 ido (还有 Cs 表示 Cr 表示 < ;左>; 不需要箭头键)。

但是您可以定义命令来在已显示的缓冲区中进行选择(这里仅从当前帧开始,如果您想要所有显示的缓冲区,您必须首先通过“frame-list”收集窗口):

(defun choose-from-shown-buffers ()
  (interactive)
  (let ((buffers (mapcar (lambda (window)
                            (buffer-name (window-buffer window)))
                         (window-list))))
      (pop-to-buffer (ido-completing-read "Buffer: " buffers))))

This is not possible unless you want to wade deep in ido's intestines.

As eGlyph already said: You're likely using ido wrongly (and there's also C-s for <right> and C-r for <left>; no need for arrow keys).

But you can define command for choosing among the already shown buffers (here only from the current frame, if you want all shown buffers you have to collect the windows first via `frame-list):

(defun choose-from-shown-buffers ()
  (interactive)
  (let ((buffers (mapcar (lambda (window)
                            (buffer-name (window-buffer window)))
                         (window-list))))
      (pop-to-buffer (ido-completing-read "Buffer: " buffers))))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文