vim scp://remotehost///path/to/file.txt


vim zipfile:/path/to/file.zip::path/inside/zip/file.txt

work for opening either remote or a file inside zip archives.

What if one needs both at the same time?

I've tried

vim scp://remotehost///path/to/file.zip

this does not open zip content as in case of local zip file.

neither of

vim zipfile:scp://remotehost///path/to/file.zip::/path/in/zip/file.txt
vim scp://remotehost//zipfile:/path/to/file.zip::/path/in/zip/file.txt


(How) is it possible to combine zipfile: and scp: in one command to open file inside the remote zip file?

  • I thought maybe if you used vim scp://host////path/to/directory to browse the remote directory, then use the ENTER key to select the zip file, you'd be able to edit it. Unfortunately you can edit the file in the zip file, but it seems the file that's written back to disk is corrupt as a zip file. I'm looking forward to seeing if anyone comes up with a good answer to this. Aug 27, 2018 at 13:18
  • You're right, I can use vim scp://host////path/to/directory/ (mind trailing slash) to browse the remote dir, select zip file and even open a file inside. Write back however fails. And the viminfo file history entry although added in form scp://host///path/to/file.zip is not re-useable.
    – Tagwint
    Aug 27, 2018 at 13:29

1 Answer 1


Both plugins (netrw and zip) use autocmds on custom file prefixes to detect special file systems (remote and zip, respectively), and then delegate the reading and writing to custom plugin code. I think the combination does not work because both use the same integration point, but I think the integrations could be extended so that some kind of syntax would work (but it could be messy).

Fortunately, both plugins are maintained by the same author (DrChip), so please suggest this enhancement to the author (his email address can be found in the plugin files and documentation, e.g. under :help pi_netrw).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.