Example Minimal Setup#
zplugin ice wait"0" blockf
zplugin light zsh-users/zsh-completions
zplugin ice wait"0" atload"_zsh_autosuggest_start"
zplugin light zsh-users/zsh-autosuggestions
zplugin ice wait"0" atinit"zpcompinit; zpcdreplay"
zplugin light zdharma/fast-syntax-highlighting
light
– load the plugin inlight
mode, in which the tracking of plugin (i.e. activity report gathering, accessible via thezplugin report {plugin-spec}
subcommand) is being disabled; note that for Turbo mode, the performance gains are actually0
, so in this mode you can load all plugins with the tracking, i.e. by usingzplugin ice wait'0'; zplugin load {plugin-spec}
commands,wait"0"
– load 0 seconds (about 110 ms exactly) after prompt,atinit''
– execute code before loading plugin,atload''
– execute code after loading plugin,zpcompinit
– equals toautoload compinit; compinit
,zpcdreplay
– executecompdef …
calls that plugins did – they were recorded, so thatcompinit
can be called later (it provides thecompdef
function, so it must be ran before issuingcompdef
s),- syntax-highlighting plugins (like
fast-syntax-highlighting
or
zsh-syntax-highlighting)
expect to be loaded last, even after the completion initialization (i.e.
compinit
function), hence theatinit''
, which will loadcompinit
right before the plugin, - the
atinit
of the plugin runs alsozpcdreplay
(i.e. "zplugin-compdef-replay"), because aftercompinit
is loaded, thecompdef
function becomes available, and one can re-run the all earlier automatically-caughtcompdef
calls, loosing nothing from the original behavior, - add
lucid
ice-mod to silence the under-prompt messages.
The same setup but without using Turbo mode (i.e. no wait''
ice):
zplugin ice blockf
zplugin light zsh-users/zsh-completions
zplugin light zsh-users/zsh-autosuggestions
autoload compinit
compinit
zplugin light zdharma/fast-syntax-highlighting