Files
neovim/runtime/doc/zip.txt
Barrett Ruth 886a270e7f refactor(zip)!: address entries with zip:// paths
Problem:
`zipfile://{archive}::{entry}` is ambiguous: `::` is legal in both an
archive path and an entry path, so the separator cannot be identified.
Splitting at the last `::` reads archives correctly but breaks entries
that contain it, and the plugin then emits buffer names it cannot read
back.

Solution:
Address entries as `zip://{archive}/{entry}`, joining the two paths.
Resolve the split by walking components: the first one that is a regular
file is the archive, because a regular file cannot have children on disk.
Entry paths may then contain any character, and no escaping is needed.

zipPlugin.vim keeps its own scheme, so the Java ftplugin emits whichever
form matches the active plugin until the legacy package is removed.
2026-08-03 15:22:25 -05:00

54 lines
1.9 KiB
Plaintext

*zip.txt* Nvim
NVIM REFERENCE MANUAL
Builtin plugin: zip *zip*
Nvim opens a read-only listing when |:edit| is used with a zip archive. The
listing is a |dir| buffer with 'filetype' set to "zip"; entries open as
read-only `zip://{archive}/{path}` buffers. Requires the `unzip`
executable.
Recognized extensions include zip, jar, apk, epub, Office and OpenDocument
formats, whl, xpi, pkpass, and cbz. Remote archives are fetched by |vim.net|.
Reading an entry from an encrypted archive prompts for its password.
*g:loaded_nvim_zip_plugin*
To disable the built-in zip browser, set this before startup: >lua
vim.g.loaded_nvim_zip_plugin = 1
<
MAPPINGS *zip-mappings*
The standard |dir-buffer-mappings|, plus:
• x extracts the entry under the cursor into the current directory, discarding
its path inside the archive. It never overwrites an existing file.
At the archive root, - opens the containing filesystem directory.
LIMITATIONS *zip-limitations*
Archive entries cannot be updated. Remote archives are not refetched on
reload, and there is no PowerShell fallback, no custom backend command, and no
support for the legacy `g:zip_*` variables. Use |old-zip| when those features
are required.
Only the original zip encryption is supported, not AES.
==============================================================================
Legacy plugin: zip *old-zip*
The legacy Vimscript zip plugin browses, updates, and extracts archive
entries. It is not loaded by default; use `:packadd` to activate it: >lua
vim.cmd.packadd('old-zip')
<
This can be done at any time. Its manual is then available as
`:help pi_zip.txt`.
vim:tw=78:ts=8:noet:ft=help