在emacs中管理数千个缓冲区

时间:2013-11-05 23:52:59

标签: emacs icicles iswitchb-mode

我正在进行一个拥有超过一万个文件的项目。我希望能够轻松浏览这些文件。

iswitchb模式对这么多文件造成严重影响; icicles速度更快,但我喜欢iswitchb的用户界面。

建议?


Stefan要求在iswitchb-mode执行中运行一个分析器:

- call-interactively                                             2740  79%
  - iswitchb-buffer                                              2628  76%
    - iswitchb                                                   2628  76%
      - iswitchb-read-buffer                                     2628  76%
        - completing-read                                        2599  75%
          - completing-read-default                              2596  75%
            - read-from-minibuffer                               2596  75%
              - iswitchb-post-command                            1034  30%
                - iswitchb-exhibit                               1034  30%
                  - iswitchb-set-common-completion                947  27%
                    - iswitchb-find-common-substri                925  26%
                      - mapcar                                    925  26%
                        - iswitchb-word-matching-s                922  26%
                          + iswitchb-case                          10   0%
                            string-match                            1   0%
                  + iswitchb-set-matches                           63   1%
                  + iswitchb-completions                           24   0%
              + redisplay_internal (C function)                   869  25%
              - timer-event-handler                               499  14%
                - byte-code                                       499  14%
                  - apply                                         499  14%
                    - jit-lock-context-fontify                    491  14%
                      + buffer-list                                15   0%
                    + show-paren-function                           6   0%
                    + display-time-event-handler                    2   0%
              + call-interactively                                 34   0%
              + icicle-unhighlight-lighter                          3   0%
              + iswitchb-pre-command                                1   0%
        + iswitchb-make-buflist                                    15   0%

5 个答案:

答案 0 :(得分:3)

如果您想使用Icicles,但希望交互行为更接近 iswitchb ,那么您可以尝试多种自定义,具体取决于 iswitchb 你喜欢的互动。请参阅 Icicles doc:Icicles - Ido and IswitchB

的此部分

Wrt使用数以万计的文件:请记住,您还可以使用 Icicles 定义projects - 您一起使用的相关文件集。与 etags 和其他方法一样,这是预过滤可能的文件名候选者的一种方法。

答案 1 :(得分:3)

刚刚在10000个缓冲区的会话中尝试过iswitchb,我确实看到它的速度难以忍受。

我建议您尝试M-x icomplete-mode:在Emacs-24.3中,默认C-x b完成已经接受子字符串匹配,就像iswitchb一样,因此唯一缺少的功能是icomplete-mode提供的功能,但icomplete-mode在使用10000个缓冲区的会话中仍然非常快。基本上,自Emacs-24.3起,iswitchb被icomplete-mode淘汰。

答案 2 :(得分:0)

你试过这个吗?

iswitchb-max-to-show is a variable defined in `iswitchb.el'.
Its value is nil

Documentation:
If non-nil, limit the number of names shown in the minibuffer.
If this value is N, and N is greater than the number of matching
buffers, the first N/2 and the last N/2 matching buffers are
shown.  This can greatly speed up iswitchb if you have a
multitude of buffers open.

You can customize this variable.

答案 3 :(得分:0)

你可以试试Helm。它可以用于切换缓冲区等等:http://amitp.blogspot.hu/2012/10/emacs-helm-for-finding-files.html

答案 4 :(得分:0)

您的数百万个文件是否可以组织成有用的集合 - 甚至可能重叠集合?

书签可以为这样的组织提供很多帮助。使用Bookmark+,您可以添加书签:

  • 个别档案。
  • 文件集。
  • 单个Dired缓冲区,记录其标记,“省略”设置和插入的子目录。
  • Dired缓冲区的稀疏树,基于标记的子目录,递归。
  • Emacs桌面。
  • 书签文件,即书签组。
  • 显示书签列表及其设置(标记,遗漏等)。

您可以标记书签,delicious - 样式。标签是您选择用于对书签或文件(即自动文件书签)进行分类的名称(任意字符串)。您可以为书签指定任意数量的标签。标签甚至可以具有相关的(任意)Lisp值。

您可以多次为同一个文件(或文件集)添加书签,并为这些不同的书签提供不同的标记。

IOW,有多种方法可以定义文件和文件集的不同“视图”。