zsh
Table of Contents
zshbuiltins
autoload
and fpath
fpath
is a array of directories which contain function files to be autoloaded
/usr/local/share/zsh/site-functions
/usr/local/Cellar/zsh/5.4.2_3/share/zsh/functions
- What
autoload
does is to mark that name as being a function rather than an external program. - The function has to be in a file on its own, with the filename the same as the function name.
- In general, you should be using
autoload -Uz <filename>
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: