tpope / vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
https://www.vim.org/scripts/script.php?script_id=5671
2.23k stars 87 forks source link

<Plug>VinegarUp breaks scp directory traversing #111

Open proever opened 5 years ago

proever commented 5 years ago

Once a remote buffer is opened in vim via, for example, vim scp://user@host/path/to/file.txt, pressing - to explore the enclosing directory no longer works.

This is due to the trailing / being stripped from the scp URL, leading to scp://user@host/path/to rather than scp://user@host/path/to/.

Typing :Explore does not cause this issue.

Interestingly, once the directory is successfully loading using :Explore, vinegar functions correctly.

artem-nefedov commented 4 years ago

This is still relevant. Fix looks very simple: add '/' at the end after expanding '%:h'. This makes it so netrw correctly opens directory for remote edits. For local edits, it should make no difference.