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?
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: :
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.
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
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.
Have you ever tried Emacs'
M-x speedbar? :-) before installing some new package I'd try an inbuilt solution...
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.
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.
Does Treemacs work. It allows you to have a treelike structure.