Skip to content

atinit

atinit'' runs a shell command after the plugin directory is set up (cloned/verified) but before the plugin is sourced. It is the first user hook to execute in the load sequence.

Terminal window
zi ice atinit"<shell-code>"
zi ice atinit"zicompinit; zicdreplay"

The code is evaluated in the context of the plugin’s directory (unless nocd'' is set). It runs on every load, not only on first clone.

Common uses:

  • Initialize completions before a syntax-highlighting plugin is sourced (the recommended pattern for turbo mode).
  • Set environment variables that the plugin reads during sourcing.

Order of execution: atinit -> atpull! -> make'!!' -> mv -> cp -> make! -> atclone/atpull -> make -> (plugin script loading) -> src -> multisrc -> atload.

Terminal window
# Initialize completions before the last completion-related plugin loads
zi ice wait lucid atinit"zicompinit; zicdreplay" blockf
zi light zsh-users/zsh-completions
  • atload
  • atclone
  • atpull
  • nocd