# Determine location of this file from the assumption that # it is linked to ~/.zshrc. This is required to find the # config files and plugins located relative to this file # directory this file is in local CFG_DIR if [ -z "$ZSH_CFG_DIR" ]; then CFG_DIR=$(dirname $(readlink -f "${(%):-%N}")) else CFG_DIR="$ZSH_CFG_DIR" fi for plugin in $CFG_DIR/plugins/*(N); do # add *.zsh if no *.plugin.zsh found local files=( $plugin/*.plugin.zsh(N) ) if [ ${#files[@]} -eq 0 ]; then files=( $plugin/*.zsh(N) ) fi for file in $files; source $file fpath=($fpath $plugin) done fpath=($CFG_DIR/functions $fpath) for fn in $CFG_DIR/functions/*(.N); autoload $(basename $fn) for conf in $CFG_DIR/conf.d/*(.N); do source "$conf" done