ed029f18010ea10c7bc4a2a90f75111503e613d9

Author
Will Boyce <me@willboyce.com>
Committer
Will Boyce <me@willboyce.com>
Date

Message

allow overriding lib/*.zsh in custom/lib

Diff

 1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 2index d0e89f31bad238dd2716779524b6765839a1bba3..d75b521c76c0e2192f42d92b709bbe414b22998f 100644
 3--- a/oh-my-zsh.sh
 4+++ b/oh-my-zsh.sh
 5@@ -8,18 +8,20 @@ fi
 6 # add a function path
 7 fpath=($ZSH/functions $ZSH/completions $fpath)
 8 
 9-# Load all of the config files in ~/oh-my-zsh that end in .zsh
10-# TIP: Add files you don't want in git to .gitignore
11-for config_file ($ZSH/lib/*.zsh); do
12-  source $config_file
13-done
14-
15 # Set ZSH_CUSTOM to the path where your custom config files
16 # and plugins exists, or else we will use the default custom/
17 if [[ -z "$ZSH_CUSTOM" ]]; then
18     ZSH_CUSTOM="$ZSH/custom"
19 fi
20 
21+# Load all of the config files in ~/oh-my-zsh that end in .zsh
22+# TIP: Add files you don't want in git to .gitignore
23+for config_file ($ZSH/lib/*.zsh); do
24+  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
25+  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
26+  source $config_file
27+done
28+
29 
30 is_plugin() {
31   local base_dir=$1