vifm/vifm

Show :tree view of selected directory in second pane

Necrom4 opened this issue · 2 comments

Just as you can show a file/directory's information in the second pane using :view, it'd be great to do the same with :tree, which is easier to view due to the icons and others..

I tried doing it my own way but it's surely not the best

" repeated code for hjkl
nnoremap h :view!<CR>:view<CR>h:if filetype('.') != 'dir' | view! | else | :sync %c<CR>:winrun , tree | endif<CR>

You can use eza or lsd to display directory trees with icons:

fileviewer */,.*/,../ eza -A --group-directories-first --no-quotes --color=always --icons=always --tree --level=3 %c

This is how it looks:
ss-selected-2024-04-11_05-51-37

As was noted on Reddit, using :tree as a preview is a weird way to go about it which results in complicated mappings. Making preview of directories look more like a tree-view would be a saner approach.

By the way, you can also try:

:set milleroptions+=rpreview:all,lsize:0 millerview
:only

It doesn't look like a tree, but otherwise formatting is consistent with file views.