Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree style listing #70

Open
lithammer opened this issue Jan 12, 2017 · 18 comments
Open

Tree style listing #70

lithammer opened this issue Jan 12, 2017 · 18 comments

Comments

@lithammer
Copy link

lithammer commented Jan 12, 2017

Would it be possible to display the files in a tree style structure, similar to let g:netrw_liststyle = 3. That's what I'm missing the most from netrw.

screen shot 2017-01-12 at 09 57 41

@justinmk
Copy link
Owner

Definitely want this, and plan to add it after 1.0 release.

@hauleth
Copy link

hauleth commented Jan 17, 2017

It would be nice to have, but probably I would not be one of the user of that. I like the way how dirvish works now and for traversing project directory I use FZF instead. Dirvish is for simple file management and jumping to files that I know that are near.

@justinmk
Copy link
Owner

@hauleth My vague plan was to just add whitespace in front of the nested files. So the buffer will still be "just a list of paths".

@viniarck
Copy link

viniarck commented Mar 2, 2017

That'd be great. Subscribing to this thread.

@shym
Copy link

shym commented May 27, 2017

Indeed that would be nice!
I imagine two things should be done:

  1. ignoring spaces at the beginning of lines (that should be easy when each line begins with the root; maybe it is an acceptable issue to not support at the same time the tree-view and using relative paths when the beginning of the path is a sequence of spaces… (which should be rare anyway))
  2. picking the right way to explore the tree (filtering files, or defining easy ways to filter files, is not that easy anymore, is it?).

I just tried how it would look like using find to populate a dirvish buffer and fixing just the "conceal" syntax rule. I think that solving just (1) would allow to suggest in the documentation a few cheap ways to get a working tree-like view.

@adamki
Copy link

adamki commented Jun 2, 2017

subbing to thread. Would love to see this added!

@Larivact
Copy link

My vague plan was to just add whitespace in front of the nested files.

I think the pipes improve readability.

@cyansprite
Copy link

perhaps you could use vim folds?

@bbtdev
Copy link

bbtdev commented Jul 24, 2018

any news regarding this? :)

@kovasap
Copy link

kovasap commented May 14, 2019

also interested!

@astier
Copy link

astier commented Jul 14, 2019

I would definitely use it.

@somini
Copy link

somini commented Jul 14, 2019

I think the pipes improve readability.

This can be done with conceal. Sort of like https://github.com/nathanaelkane/vim-indent-guides

@GabeDuarteM
Copy link

Definitely want this, and plan to add it after 1.0 release.

@justinmk Is there any place where we can see what is missing for the 1.0 release?

That message was posted two years ago, is this still a desired feature, or did it lost priority?

@justinmk
Copy link
Owner

It's desired but I won't have time to work on it soon.

wincent added a commit to wincent/wincent that referenced this issue Apr 13, 2020
As much as I like having a tree view available to me, the slowness of
NERDTree is driving me up the wall. Hopefully, tree view will come to
Dirvish eventually:

justinmk/vim-dirvish#70
@yogeshdhamija
Copy link
Contributor

yogeshdhamija commented May 10, 2020

I'd also love this feature, but I respect that you don't have the time now.

In the meantime, I've been using the following in my vimrc, which is sufficient for me and might be useful to others. Screenshot:

image

It changes the behaviour of the p key (preview) to show the subdirectories of a dirvish entry in the same buffer. It can be repeated on the subdirectory.

        augroup dirvish_config
            autocmd!
            autocmd FileType dirvish
                        \ nnoremap <silent><buffer> p ddO<Esc>:let @"=substitute(@", '\n', '', 'g')<CR>:r ! find "<C-R>"" -maxdepth 1 -print0 \| xargs -0 ls -Fd<CR>:silent! keeppatterns %s/\/\//\//g<CR>:silent! keeppatterns %s/[^a-zA-Z0-9\/]$//g<CR>:silent! keeppatterns g/^$/d<CR>:noh<CR>
        augroup END

I know it's gnarly. I've tested it in WSL in Windows, as well as iterm2 on a mac. Works with both vim and neovim.

It relies on the find and xargs unix commands.

@justinmk
Copy link
Owner

justinmk commented May 10, 2020

@ydhamija96 that's cool, I love seeing hacks like that. Maybe send a PR that adds that in :h dirvish-faq

@yogeshdhamija
Copy link
Contributor

Cool! I've opened a PR.

PR #176

@paniash
Copy link

paniash commented Jul 30, 2021

Any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests