justinmk / vim-dirvish

Directory viewer for Vim :zap:
Other
1.19k stars 64 forks source link

remap :Explore command #224

Closed thevan96 closed 2 years ago

thevan96 commented 2 years ago

I remap dirvish like netrw: Explore, Vexplore. But using it with no arguments does not show the file's directory we are editing, instead of the folder root.

How to remap Explore, Vexplore when using it with no arguments will show the directory of the file we are editing?

justinmk commented 2 years ago

say exactly what you tried, in code

thevan96 commented 2 years ago
let g:loaded_netrwPlugin = 1
command! -nargs=? -complete=dir Explore Dirvish <args>
command! -nargs=? -complete=dir Sexplore belowright split | silent Dirvish <args>
command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish <args>

I want to explore the folder where the current file is. Instead root project

justinmk commented 2 years ago
command! -nargs=? -complete=dir Explore exe 'Dirvish '.(empty(<q-args>)?'%':<q-args>)
thevan96 commented 2 years ago

That work, thank you.