load
Summary
Section titled “Summary”load'' provides a condition that, when true, causes a previously-unloaded plugin to
reload. Paired with unload'', it enables context-sensitive plugin loading.
Syntax / Usage
Section titled “Syntax / Usage”zi ice load"[[ $PWD = */github* ]]"zi load user/github-pluginDetails
Section titled “Details”The condition is evaluated on each prompt (via precmd hook). When it becomes true and
the plugin is not currently loaded, the plugin is loaded. Once loaded, the condition
becoming true again does not trigger a second load — the plugin must first be unloaded
via the unload'' condition.
load'' pairs naturally with unload'' to create plugins that activate and deactivate
based on the current directory or other shell state.
Does not work with snippets.
Examples
Section titled “Examples”# Load a plugin only when inside a GitHub-related directoryzi ice load'[[ $PWD = */github* ]]' unload'[[ $PWD != */github* ]]'zi load user/github-helpersSee Also
Section titled “See Also”- unload
- if
- has