- Put these in a
$DOTFILES/zsh/functions
folder - Make sure completions is loaded in your ZSH
- Add functions path to the
fpath
in~/.zshenv
- Autoload the functions in your
~/.zshrc
# ~/.zshenv
fpath=(
$DOTFILES/zsh/functions
$fpath
)
autoload -U compinit && compinit
# ~/.zshrc
if [[ -d $DOTFILES/zsh/functions ]]; then
for func in $DOTFILES/zsh/functions/*(:t); autoload -U $func
fi