Skip to content

Commit 7c4dc59

Browse files
yogeshdhamijajustinmk
authored andcommitted
doc: mention hack for expanding a directory inline (tree-style)
ref #70 close #176
1 parent a197607 commit 7c4dc59

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/dirvish.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,5 +239,18 @@ Put this in your vimrc: >
239239
command! -nargs=? -complete=dir Sexplore belowright split | silent Dirvish <args>
240240
command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish <args>
241241
242+
How to expand a directory inline (like a tree-style view)? ~
243+
There is a hacky solution. Put this in your vimrc and hit "t" on a directory: >
244+
245+
augroup dirvish_config
246+
autocmd!
247+
autocmd FileType dirvish
248+
\ nnoremap <silent><buffer> t 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>
249+
augroup END
250+
251+
Note:
252+
- Expects unix-style filepaths.
253+
- Will overwrite your " register.
254+
242255
==============================================================================
243256
vim:tw=78:ts=4:et:ft=help:norl:

0 commit comments

Comments
 (0)