Skip to content

Commit 191341c

Browse files
committed
fix(mappings): "." on current directory
Problem: If "." is used on a line corresponding the current directory, Dirvish prefills the cmdline: :! '' Solution: Prefill '.' instead of '' for CWD. :! '.'
1 parent c9cf284 commit 191341c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ftplugin/dirvish.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ execute 'xnoremap '.s:nowait.'<buffer> P '.s:call_prefix.'call dirvish#open("
5050
nnoremap <buffer><silent> R :<C-U><C-R>=v:count ? ':let g:dirvish_mode='.v:count.'<Bar>' : ''<CR>Dirvish<CR>
5151
nnoremap <buffer><silent> g? :help dirvish-mappings<CR>
5252
53-
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(fnamemodify(getline("."),":."))))."<Home><C-Right>"'
53+
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(empty(fnamemodify(getline("."),":.")) ? "." : fnamemodify(getline("."),":."))))."<Home><C-Right>"'
5454
execute 'xnoremap <expr>'.s:nowait.'<buffer> . ":Shdo".(v:count?"!":" ")." {}<Left><Left><Left>"'
5555
execute 'nnoremap <expr>'.s:nowait.'<buffer> cd ":<C-u>".(v:count ? "cd" : "lcd")." %<Bar>pwd<CR>"'
5656

0 commit comments

Comments
 (0)