vim-dirvish
vim-dirvish copied to clipboard
Tree style listing
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.
Definitely want this, and plan to add it after 1.0 release.
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.
@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".
That'd be great. Subscribing to this thread.
Indeed that would be nice! I imagine two things should be done:
- 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))
- 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.
subbing to thread. Would love to see this added!
My vague plan was to just add whitespace in front of the nested files.
I think the pipes improve readability.
perhaps you could use vim folds?
any news regarding this? :)
also interested!
I would definitely use it.
I think the pipes improve readability.
This can be done with conceal
. Sort of like https://github.com/nathanaelkane/vim-indent-guides
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?
It's desired but I won't have time to work on it soon.
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:
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.
@ydhamija96 that's cool, I love seeing hacks like that. Maybe send a PR that adds that in :h dirvish-faq
Cool! I've opened a PR.
PR #176
Any news on this?