From 1828c4e09edf3e9779df8c27ad7df1b24d59fa25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Tue, 15 Nov 2011 01:04:55 -0500 Subject: [PATCH] fpath set incorrectly for custom plugins This defers setting the fpath for plugins until the plugins are actually loaded so we know where it was loaded from. --- oh-my-zsh.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 891e8d467..59fa89683 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -13,10 +13,6 @@ fpath=($ZSH/functions $ZSH/completions $fpath) # TIP: Add files you don't want in git to .gitignore for config_file ($ZSH/lib/*.zsh) source $config_file -# Add all defined plugins to fpath -plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) - # Load and run compinit autoload -U compinit compinit -i @@ -28,11 +24,16 @@ then ZSH_CUSTOM="$ZSH/custom" fi -# Load all of the plugins that were defined in ~/.zshrc +# Load all of the plugins that were defined in ~/.zshrc and +# add them to fpath. +plugin=${plugin:=()} +for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) for plugin ($plugins); do if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then + fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then + fpath=($ZSH/plugins/$plugin $fpath) source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi done