if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:nowait = (v:version > 703 ? '' : '') let s:sep = exists('+shellslash') && !&shellslash ? '\' : '/' if !hasmapto('(dirvish_quit)', 'n') execute 'nmap '.s:nowait.' q (dirvish_quit)' execute 'nmap '.s:nowait.' gq (dirvish_quit)' endif if !hasmapto('(dirvish_arg)', 'n') execute 'nmap '.s:nowait.' x (dirvish_arg)' execute 'xmap '.s:nowait.' x (dirvish_arg)' endif if !hasmapto('(dirvish_K)', 'n') execute 'nmap '.s:nowait.' K (dirvish_K)' execute 'xmap '.s:nowait.' K (dirvish_K)' endif if has('nvim') || has('patch-8.2.1978') let s:command_prefix = '' let s:call_prefix = '' let s:cmdsuf = '' else let s:command_prefix = ':' let s:call_prefix = ':.' let s:cmdsuf = ":echon ''" endif execute 'nnoremap '.s:nowait.' ~ '.s:command_prefix.'Dirvish ~/'.s:cmdsuf execute 'nnoremap '.s:nowait.' i '.s:call_prefix.'call dirvish#open("edit", 0)'.s:cmdsuf execute 'nnoremap '.s:nowait.' '.s:call_prefix.'call dirvish#open("edit", 0)'.s:cmdsuf execute 'nnoremap '.s:nowait.' a '.s:call_prefix.'call dirvish#open("vsplit", 1)'.s:cmdsuf execute 'nnoremap '.s:nowait.' o '.s:call_prefix.'call dirvish#open("split", 1)'.s:cmdsuf execute 'nnoremap '.s:nowait.' p '.s:call_prefix.'call dirvish#open("p", 1)'.s:cmdsuf execute 'nnoremap '.s:nowait.' <2-LeftMouse> '.s:call_prefix.'call dirvish#open("edit", 0)'.s:cmdsuf execute 'nnoremap '.s:nowait.' dax :arglocalsilent! argdelete *echo "arglist: cleared"Dirvish' execute 'nnoremap '.s:nowait.' j:call feedkeys("p")' execute 'nnoremap '.s:nowait.' k:call feedkeys("p")' if !has('nvim') && !has('patch-8.2.1978') let s:call_prefix = ':' endif execute 'xnoremap '.s:nowait.' I '.s:call_prefix.'call dirvish#open("edit", 0)'.s:cmdsuf execute 'xnoremap '.s:nowait.' '.s:call_prefix.'call dirvish#open("edit", 0)'.s:cmdsuf execute 'xnoremap '.s:nowait.' A '.s:call_prefix.'call dirvish#open("vsplit", 1)'.s:cmdsuf execute 'xnoremap '.s:nowait.' O '.s:call_prefix.'call dirvish#open("split", 1)'.s:cmdsuf execute 'xnoremap '.s:nowait.' P '.s:call_prefix.'call dirvish#open("p", 1)'.s:cmdsuf nnoremap R :=v:count ? ':let g:dirvish_mode='.v:count.'' : ''Dirvish nnoremap g? :help dirvish-mappings execute 'nnoremap '.s:nowait.' . ":".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(empty(fnamemodify(getline("."),":.")) ? "." : fnamemodify(getline("."),":."), 1))).""' execute 'xnoremap '.s:nowait.' . ":Shdo".(v:count?"!":" ")." {}"' execute 'nnoremap '.s:nowait.' cd ":".(v:count ? "cd" : "lcd")." %pwd"' " Buffer-local / and ? mappings to skip the concealed path fragment. if s:sep == '\' nnoremap / /\ze[^\/]*[\/]\=$ nnoremap ? ?\ze[^\/]*[\/]\=$ else nnoremap / /\ze[^/]*[/]\=$ nnoremap ? ?\ze[^/]*[/]\=$ endif " Force autoload if `ft=dirvish` if !exists('*dirvish#open')|try|call dirvish#open()|catch|endtry|endif