zsh

Table of Contents

zshbuiltins

autoload and fpath

print -l $fpath
/usr/local/share/zsh/site-functions
/usr/local/Cellar/zsh/5.4.2_3/share/zsh/functions
autoload -Uz compinit
#         │└─ usual alias expansion during reading will be suppressed
#         └── force use zsh-style autoload not KSH

If you want to use compinit, you should call autoload for it before using it, otherwise the name compinit will be simply an unknown command. This goes a common idiom as following:

autoload -Uz compinit && compinit

Links