wait
Summary
Section titled “Summary”wait'' defers plugin loading until after the shell prompt is first displayed, enabling
turbo mode. It is the primary mechanism for achieving fast shell startup with Zinit.
Syntax / Usage
Section titled “Syntax / Usage”zi wait'' light zsh-users/zsh-syntax-highlighting
# Wait N seconds (float) after promptzi wait'1' light some/plugin
# Wait for a condition: zsh event or arbitrary expressionzi wait'[[ -n $TMUX ]]' light some/pluginDetails
Section titled “Details”When wait'' is set, the plugin is loaded asynchronously after the first prompt is
rendered. The empty string wait'' is equivalent to wait'0' — zero-second defer,
meaning “as soon as the prompt is shown.”
The value can be:
- An integer or float: seconds to wait after the prompt
- A zsh conditional expression in
[[...]]: loading is deferred until the expression is true, checked on eachprecmdhook - An event name prefixed with
!: loading triggers on that zsh event
Order of loading among wait'' plugins is determined by the order they appear in the
config and by their wait value.
wait'' is the defining feature of turbo mode. Without it, all plugins load
synchronously before the first prompt.
Examples
Section titled “Examples”# Typical turbo block: defer syntax highlighting and autosuggestionszi wait'' lucid light zsh-users/zsh-syntax-highlightingzi wait'' lucid light zsh-users/zsh-autosuggestions
# Load only inside tmux sessionszi wait'[[ -n $TMUX ]]' lucid light tmux/pluginCaveats / Common Mistakes
Section titled “Caveats / Common Mistakes”- Plugins that set key bindings (e.g. fzf tab completion) must have their bindings
re-applied after loading; use the
atload''ice for this. - Completions added by a
wait''-deferred snippet may not be available until the next prompt cycle; pair withlucidto suppress the loading message. - Avoid
wait''on plugins that define functions needed during.zshrcevaluation (e.g. theme loading). Those should load synchronously.
See Also
Section titled “See Also”- lucid
- turbo-mode
- atload