is there an emacs tool to show a directory structure as a tree?
Asked Answered
D

4

15

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)))
Dennett answered 7/8, 2010 at 23:57 Comment(0)
C
4

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

Contemporize answered 8/8, 2010 at 0:50 Comment(0)
U
6

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.

Unsettle answered 28/11, 2013 at 10:6 Comment(0)
C
4

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

Contemporize answered 8/8, 2010 at 0:50 Comment(0)
K
2

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.

Karmakarmadharaya answered 8/8, 2010 at 1:4 Comment(0)
A
2

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

NeoTree screenshot, from EmacsWiki

Aweinspiring answered 27/4, 2015 at 14:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.