zi snippet
Summary
Section titled “Summary”Source a local or remote file directly by URL. Use this to load single-file scripts, Oh My Zsh library files, Prezto modules, or any raw Zsh file without treating it as a full plugin repository.
Syntax / Usage
Section titled “Syntax / Usage”zi snippet [-f] {url|shorthand}-f— force redownload, bypass the local cache.
Supported shorthands (expand to raw GitHub URLs automatically):
| Shorthand | Expands to |
|---|---|
OMZ:: | https://github.com/ohmyzsh/ohmyzsh/raw/master/ |
OMZL:: | OMZ lib/ |
OMZP:: | OMZ plugins/ |
OMZT:: | OMZ themes/ |
PZT:: | https://github.com/sorin-ionescu/prezto/tree/master/ |
PZTM:: | Prezto modules/ |
Details
Section titled “Details”Downloaded snippets are cached in $ZINIT[SNIPPETS_DIR] (default: ~/.local/share/zinit/snippets). On subsequent shell starts Zinit sources from the cache rather than re-fetching. Use -f or zi update {URL} to refresh the cache. When using the svn ice, an entire subdirectory can be cloned via Subversion (useful for multi-file OMZ plugins). The as"completion" ice tells Zinit to treat the sourced file as a completion function rather than a script to source.
Examples
Section titled “Examples”# Raw URLzi snippet https://gist.githubusercontent.com/hightemp/5071909/raw/
# Oh My Zsh library and pluginzi snippet OMZL::git.zshzi snippet OMZP::git
# Oh My Zsh themezi snippet OMZT::robbyrussell
# Prezto modulezi snippet PZTM::environment
# Multi-file OMZ plugin via SVNzi ice svnzi snippet OMZP::gitfast
# Single-file completion snippetzi ice as"completion"zi snippet OMZP::docker/_dockerCaveats / Common Mistakes
Section titled “Caveats / Common Mistakes”Shorthands like svn and cloneopts do not work with snippets — they are plugin-only ices. If a snippet silently loads stale content, use -f to force a fresh download.
See Also
Section titled “See Also”- cmd-load
- cmd-ice
- cmd-cdreplay
- cmd-update