This ext implements http operations.
The downloader accepts plugin URLs in these forms:
-
Archive downloads (examples):
- GitHub archive:
https://github.com/<owner>/<repo>/archive/.../xxx.zip - GitLab archive:
https://gitlab.com/<owner>/<repo>/-/archive/.../*.zip - Bitbucket get:
https://bitbucket.org/<owner>/<repo>/get/<hash>.zip - Releases/download assets:
https://github.com/<owner>/<repo>/releases/download/<tag>/<asset> - Direct archive files:
https://example.com/path/to/foo.zip(or.tar.gz/.tgz/...) - Plain GitHub repo root:
https://github.com/<owner>/<repo>is accepted and normalized to an archive URL (see notes below).
- GitHub archive:
-
Raw single-file URLs:
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/path/to/file.vimNOTE: these are downloaded as a single file.
Notes about plain repo roots and revisions (rev)
- Plain repository root URLs such as
https://github.com/owner/repoare now accepted and will be normalized to an archive download URL:https://github.com/owner/repo/archive/refs/heads/<rev>.zip.- If no revision is provided, the downloader uses a default of
main. - You can supply a revision (branch, tag, or commit SHA) - the
revparameter - to select a specific branch/tag/commit (e.g.dev-branch,v1.2.3, or a commit SHA). - If the repository's default branch is not
main, either pass the correctrev, or enable an option that queries the remote API to discover the repository's default branch (this implementation currently uses the providedrevormainby default).
- If no revision is provided, the downloader uses a default of
- If an input URL already points to an archive path (e.g.
.../archive/refs/heads/main.zip) and arevis provided, the code will attempt to replace the referenced ref with the suppliedrevwhere possible.
Other handling
git+https://prefix is normalized away (e.g.git+https://github.com/...->https://github.com/...).- URLs that already end with known archive extensions (zip/tar.* etc.), archive
patterns, release assets, raw file URLs, and Bitbucket
getURLs are returned as-is (possibly with credentials removed and host normalized to lowercase). - SSH-style URLs (
git@github.com:owner/repo.git) and owner/repo shorthand (owner/repo) are not treated as downloadable HTTP URLs by this downloader.
Supported hosts and patterns
- GitHub (archive, releases/download, explicit
rawpaths, plain repo roots) - GitLab (archive patterns like
/-/archive/...) - Bitbucket (the
/get/pattern) - Generic direct archive URLs on arbitrary hosts
- raw.githubusercontent.com single-file URLs
Limitations
- This approach downloads and extracts archives or single files; it does not
perform
git clone. Plugins that require git metadata, submodules, or other repository operations may not work correctly. - If you rely on automatic default-branch detection, consider enabling an API
lookup to avoid incorrect assumptions about
mainvsmaster(not enabled by default).
NOTE: The protocol does not support version lock and rollback.
NOTE: To download plugins, "curl" or "wget" is required.
https://github.com/vim-denops/denops.vim
https://github.com/Shougo/dpp.vim
To download and extract plugins the runtime relies on common CLI tools. At minimum one downloader is required:
-
Required (at least one):
curlorwget— used to download files from HTTP(S) URLs NOTE: If neithercurlnorwgetis available the downloader cannot work.
-
Required for archive extraction (at least one set, depending on archive type):
- For ZIP archives:
unzipORpython3(zipfile module) — one of these must be available to extract.zip.
- For tar archives (
.tar,.tar.gz,.tgz,.tar.bz2,.tar.xz):tarORpython3(tarfile module) — one of these must be available to extract tar-like archives.
- For ZIP archives:
-
Optional but recommended for robust mover/cleanup:
cporrsync— used to move extracted files from a temporary directory into the final destination when needed (zip extraction often creates a top-level folder).rm— cleanup temporary files/directories.
Summary:
- Downloader:
curlorwget(required) - Extractors:
- zip:
unziporpython3 - tar:
tarorpython3
- zip:
- Movers (recommended):
cporrsync(orpython3mover) - Cleanup:
rm
args.contextBuilder.setGlobal({
protocols: [
"http",
],
});