Closed TamaMcGlinn closed 2 years ago
Thanks for the report. I definitely tested this on unix + Windows, with various dirvish settings, so will need exact steps to reproduce.
Found it; looks like you removed this default mapping accidentally:
if !hasmapto('<Plug>(dirvish_up)', 'n')
execute 'nmap '.s:nowait.'<buffer> - <Plug>(dirvish_up)'
endif
It wasn't an accident, there is already a global mapping defined in plugin/dirvish.vim
. Did you, or a plugin, override the global -
mapping? If so, you can define a buffer-local one:
au FileType dirvish nmap - <plug>(dirvish_up)
Yes, I had defined the global - mapping to open the directory of the current file in Dirvish, which feels consistent with using - inside Dirvish. Yes, of course I can just copy the line into my local config to fix this instead. Thanks.
I had defined the global - mapping to open the directory of the current file in Dirvish, which feels consistent with using - inside Dirvish.
Hmm, that's been the default behavior of global -
for a long time.
Also recently changed :Dirvish
command to do that: https://github.com/justinmk/vim-dirvish/commit/a65debefd9928f331587c76f20a41fedf827fc4c
Just a typical case of spacebar heating :) I am adjusting the workaround in my plugin, no need for any changes in dirvish. In case you're interested in the details:
I use terminals inside NeoVim a lot, and sometimes I change directories in that terminal, but then find I want to quickly open up one of the directories mentioned on the commandline. Since just remapping inside ftplugin/terminal.vim doesn't work (vim-dirvish mapping takes preference over it), my chosen hack was to remap globally and check the filetype inside the function:
function! browsedir#BrowseDir() abort
if &buftype ==# 'terminal'
let l:dir = dirhere#GetDirFromPrompt()
call better_gf#JumpToNormalBuffer()
execute ':e '.l:dir
else
e %:h
endif
endfunction
Since I also wanted to support people using non-Dirvish editors, I call e %:h
which ends up calling Dirvish. This happened to work because Dirvish was also mapping the key again in the ftplugin file.
I was, of course, not aware of any of this interplay until your recent commit, which rightly calls the ftplugin mapping superfluous.
Is this solved? I'm having the same problem
Yes; my fix was in this commit, and you can install the browsedir plugin to fix this for you as well.
OK thank you that fixed it, would be interesting to find the offending mapping too
I was used to being able to press
-
to go up from one directory to its parent. This commit broke that:I'm still investigating why.