vim-vinegar
vim-vinegar copied to clipboard
- broken under Vim >= 9.0 ?
Using Vim 9.0.2103 under Linux with netrwPlugin.vim from Feb 09, 2021.
Typing
vim --clean -u ~/.viminrc
with ~/.viminrc reading
set nocompatible
let &rtp = '~/.vim/plugged/vim-vinegar/' . ',' . &rtp
then
:~/.vim/plugged/vim-vinegar/README.markdown<cr>-
shows the cursor at the first line instead of README.markdown.
The issue persists under Vim 9.1.151 and (autoload) netrw (from 2024 Feb 29)
The only workaround I could come up with is temporarily switching to the file's dir, such as adding
nnoremap <silent> <SID>(lcd) :<c-u>lcd %:p:h<CR>
nmap <silent> - <SID>(lcd)<Plug>VinegarUp
or, to restore the current work dir,
nnoremap <silent> - :<c-u>call <SID>VinegarUp()<CR>
fun s:VinegarUp()
let save_dir = chdir(expand('%:p:h'))
if !empty(save_dir)
exe "normal \<Plug>VinegarUp"
call chdir(save_dir)
endif
endf
to ~/.viminrc