I love dired, but sometimes (particularly when filming screencasts) I want to see the tree-structure of a directory and its children, a la the tree(1) command. Is there a tree-oriented directory browser for Emacs?

  • Pretty sure ecb can do this.
    – c-o-d
    Commented Sep 28, 2014 at 21:34
  • 2
    @EdgarAroutiounian If that's the case, I recommend making an answer out of it :)
    – Trevoke
    Commented Sep 29, 2014 at 12:15
  • Although it isn't a folding tree filemanager, I would recommend ranger.el! If you don't like the Miller columns you can easily switch to minimal ranger mode (deer).
    – lupl
    Commented Jun 17, 2021 at 7:25

7 Answers 7


Additionally you can use dired-subtree from dired-hacks repo.

Here you have short demo and screenshot from my setup where I press i to drill down folder and ; to go back.:

  (define-key dired-mode-map "i" 'dired-subtree-insert)
  (define-key dired-mode-map ";" 'dired-subtree-remove)


PS I'm also aware of direx which looks like that: direx:

  • I've tried dired-subtree but the tree structure wasn't as visually apparent as I was looking for. Direx looks perfect tho, I'm gonna go try it.
    – Avdi
    Commented Sep 29, 2014 at 22:40
  • 1
    I'm this one because the suggestion of Direx looks ideal for my use case of putting a directory tree visualization front and center. That's not to discount @keelerm's excellent suggestions though.
    – Avdi
    Commented Sep 29, 2014 at 22:49
  • You can get equivalent functionality using one key binding: (define-key dired-mode-map "i" 'dired-subtree-toggle). I like to map it to "C-c i" though since dired also does insert subdirectory using "i".
    – Joe
    Commented Oct 6, 2019 at 20:47

There are a couple of options for this.

You can check out dirtree, which is based on dired.

There is also an emacs port of vim's NERDTree called neotree.

Both are excellent packages, though I tend to favor neotree as it has convenient bindings to let me create and delete files and directories. I do not believe dirtree has this support, though I could be wrong. It has been a while since I last used it.

  • Thanks, while direx looks to be ideal for my immediate need, you've reminded me that I need to spend some time with neotree.
    – Avdi
    Commented Sep 29, 2014 at 22:50

Have you ever tried Emacs' M-x speedbar? :-) before installing some new package I'd try an inbuilt solution...

Update 2020-01-10

Actually I'm using now dired-sidebar which is available via Melpa.

  • 3
    …and one more upvote for suggesting a builtin. Commented Sep 12, 2017 at 18:20

You can invoke dired with an argument, ie. C-u C-x d and after prompting for the directory it will also let you modify the switches passed to ls. Add R and dired will recursively list all sub-directories, each in it's own section.

If you only want to see the contents of some sub-directories, press i when the point is on a directory name.

You can also use the find-dired command, with or without switches. Instead of showing sub-directories in their own section it prints the full path of each file. You can toggle showing file details with ( so that the long paths fit horizontally on screen.

These are all built-in.


There is also ztree. I use it when I need to take a look at directory structure, although usually I use vanilla Dired for all other things.


Treemacs works. It allows you to have a treelike structure.

  • Is this an answer or a question (two questions)? It is pretty-much a link-only answer, if it is an answer. As such, it risks being deleted. See emacs.stackexchange.com/help/how-to-ask.
    – Drew
    Commented Nov 18, 2017 at 0:13
  • 1
    @Drew, fwiw I think this is just a language/interpretation issue. Treemacs is an absolutely acceptable suggestion to the OP's question. Commented Jan 6, 2018 at 4:08

Take a look at sidebar.el.

As the repo said, it is is a customizable file explorer with git integration, but not only that. You can also get the list of buffers and your maildirs with mu4e.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.