summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/zshrc b/zshrc
index 5385352..158225a 100644
--- a/zshrc
+++ b/zshrc
@@ -3,7 +3,12 @@
# config files and plugins located relative to this file
# directory this file is in
-CFG_DIR=$(dirname $(readlink -f ~/.zshrc))
+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