Skip to content

Commit

Permalink
fix(mappings): "." on current directory
Browse files Browse the repository at this point in the history
Problem:
If "." is used on a line corresponding the current directory, Dirvish
prefills the cmdline:

    :! ''

Solution:
Prefill '.' instead of '' for CWD.

    :! '.'
  • Loading branch information
justinmk committed Jun 6, 2023
1 parent c9cf284 commit 191341c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftplugin/dirvish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ execute 'xnoremap '.s:nowait.'<buffer> P '.s:call_prefix.'call dirvish#open("
nnoremap <buffer><silent> R :<C-U><C-R>=v:count ? ':let g:dirvish_mode='.v:count.'<Bar>' : ''<CR>Dirvish<CR>
nnoremap <buffer><silent> g? :help dirvish-mappings<CR>
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(fnamemodify(getline("."),":."))))."<Home><C-Right>"'
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(empty(fnamemodify(getline("."),":.")) ? "." : fnamemodify(getline("."),":."))))."<Home><C-Right>"'
execute 'xnoremap <expr>'.s:nowait.'<buffer> . ":Shdo".(v:count?"!":" ")." {}<Left><Left><Left>"'
execute 'nnoremap <expr>'.s:nowait.'<buffer> cd ":<C-u>".(v:count ? "cd" : "lcd")." %<Bar>pwd<CR>"'

Expand Down

0 comments on commit 191341c

Please sign in to comment.