vim-vinegar icon indicating copy to clipboard operation
vim-vinegar copied to clipboard

- broken under Vim >= 9.0 ?

Open Konfekt opened this issue 1 year ago • 2 comments

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.

Konfekt avatar Mar 13 '24 08:03 Konfekt

The issue persists under Vim 9.1.151 and (autoload) netrw (from 2024 Feb 29)

Konfekt avatar Mar 13 '24 08:03 Konfekt

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

Konfekt avatar Mar 13 '24 09:03 Konfekt