zsh-config/zsh/05-plugins.zsh

18 lines
487 B
Bash
Raw Normal View History

2021-04-03 17:01:19 +05:00
# Load enabled plugins.
for plugin in "${ENABLED_PLUGINS[@]}"; do
if [ "${plugin}" = "" ]; then
continue
fi
2021-04-03 17:01:19 +05:00
if [ ! -f "${CONFIG_PATH}/zsh/plugins/${plugin}.plugin.zsh" ]; then
error 0 "Plugin '${plugin}' doesn't exist"
else
source "${CONFIG_PATH}/zsh/plugins/${plugin}.plugin.zsh"
# chpwd injecting.
chpwd_injector=`declare -f ${plugin}_chpwd`
if [ $chpwd_injector ]; then
${plugin}_chpwd
fi
fi
done