有没有 emacs 工具可以将目录结构显示为树?

发布于 2024-09-13 04:33:06 字数 1542 浏览 6 评论 0原文

我知道 Speedbar(我更喜欢与我的其他作品在同一框架中的结构),并且 dired 显示了太多信息。我正在寻找类似 svn-status 树表示的东西。有这样的事吗? 谢谢。

编辑:这是我发现的最直观的:

我正在使用 Speedbar 以及来自 此处。我不得不使用评论的“尝试这个”部分,仅供参考。

  (require 'speedbar)
  (defconst my-speedbar-buffer-name "SPEEDBAR")
  ; (defconst my-speedbar-buffer-name " SPEEDBAR") ; try this if you get "Wrong type argument: stringp, nil"
  (defun my-speedbar-no-separate-frame ()
    (interactive)
    (when (not (buffer-live-p speedbar-buffer))
      (setq speedbar-buffer (get-buffer-create my-speedbar-buffer-name)
            speedbar-frame (selected-frame)
            dframe-attached-frame (selected-frame)
            speedbar-select-frame-method 'attached
            speedbar-verbosity-level 0
            speedbar-last-selected-file nil)
      (set-buffer speedbar-buffer)
      (speedbar-mode)
      (speedbar-reconfigure-keymaps)
      (speedbar-update-contents)
      (speedbar-set-timer 1)
      (make-local-hook 'kill-buffer-hook)
      (add-hook 'kill-buffer-hook
                (lambda () (when (eq (current-buffer) speedbar-buffer)
                             (setq speedbar-frame nil
                                   dframe-attached-frame nil
                                   speedbar-buffer nil)
                             (speedbar-set-timer nil)))))
    (set-window-buffer (selected-window) 
                       (get-buffer my-speedbar-buffer-name)))

I am aware of Speedbar (I prefer the structure in the same frame as the rest of my work), and dired shows too much information. I'm after something like the svn-status tree representation. Is there anything like that?
Thank you.

EDIT: Here's what I found the most intuitive:

I am using Speedbar with the following hack from here. I had to use the commented "try this" part, FYI.

  (require 'speedbar)
  (defconst my-speedbar-buffer-name "SPEEDBAR")
  ; (defconst my-speedbar-buffer-name " SPEEDBAR") ; try this if you get "Wrong type argument: stringp, nil"
  (defun my-speedbar-no-separate-frame ()
    (interactive)
    (when (not (buffer-live-p speedbar-buffer))
      (setq speedbar-buffer (get-buffer-create my-speedbar-buffer-name)
            speedbar-frame (selected-frame)
            dframe-attached-frame (selected-frame)
            speedbar-select-frame-method 'attached
            speedbar-verbosity-level 0
            speedbar-last-selected-file nil)
      (set-buffer speedbar-buffer)
      (speedbar-mode)
      (speedbar-reconfigure-keymaps)
      (speedbar-update-contents)
      (speedbar-set-timer 1)
      (make-local-hook 'kill-buffer-hook)
      (add-hook 'kill-buffer-hook
                (lambda () (when (eq (current-buffer) speedbar-buffer)
                             (setq speedbar-frame nil
                                   dframe-attached-frame nil
                                   speedbar-buffer nil)
                             (speedbar-set-timer nil)))))
    (set-window-buffer (selected-window) 
                       (get-buffer my-speedbar-buffer-name)))

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

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

发布评论

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

评论(4

通知家属抬走 2024-09-20 04:33:06

所以我想快速打印一棵树,所有基于 Emacs 的解决方案看起来要么相当旧,要么像(ECB/CEDET)那样庞大,我对此不太了解,所以为了快速修复,我

sudo apt-get install tree

从可怕的缓冲区中

M-! tree --dirsfirst RET

做了,瞧!没有任何特定库的目录树,作为使用 tree -f 输出具有完整路径的树的额外好处,使得直接从树输出跳转到使用 Cx Cf 的文件变得显而易见缓冲。

So I wanted to just print a tree quickly and all Emacs based solutions seemed either rather old or massive like (ECB/CEDET) which I don't know enough about, so for quick fix I did

sudo apt-get install tree

then from dired buffer

M-! tree --dirsfirst RET

voilà! directory tree without any specific libs, as an added bonus using tree -f outputs tree with full paths, making it obvious to jump to file with C-x C-f directly from the tree output buffer.

梦魇绽荼蘼 2024-09-20 04:33:06

emacs 模式有一个 树扩展 日出指挥官。日出指挥官就像午夜指挥官。

There is a tree extension for emacs mode Sunrise Commander. Sunrise Commander is like Midnight Commander.

画尸师 2024-09-20 04:33:06

Emacs 代码浏览器。最后我听说在当前的 emacs 中使用它可能会很棘手或困难,因为它使用了一些最近通过 CEDET

There's the Emacs Code Browser. Last I heard using it with a current emacs may be tricky or difficult because it makes use of some tools that were recently integrated into Emacs via CEDET.

苏大泽ㄣ 2024-09-20 04:33:06

我推荐 NeoTree。它易于安装且易于使用。

NeoTree 屏幕截图,来自 EmacsWiki

I'd recommend NeoTree. It's easy to install and easy to use.

NeoTree screenshot, from EmacsWiki

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文