justinmk / vim-dirvish

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

Modifying `-` mapping #178

Closed msclp closed 4 years ago

msclp commented 4 years ago

Noticed that when nothing is mapped to - it opens Dirvish in cwd, but when I open some file - mapping does not work I wrote a function to do something like this

function! Files()
  if expand('%:p') != ''
    :Dirvish %
  else
    :Dirvish
  endif
endfunction

nmap <silent> - :call Files()<cr>

Is there a better way to accomplish that or maybe some area to enhance Drvish or maybe I'm doing something wrong and - works in an empty buffer as well as in opened file

msclp commented 4 years ago

I found the issue, your plugin works well I had to modify g:list_of_normal_keys of hardtime plugin and remove '-' from array