summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc30
1 files changed, 20 insertions, 10 deletions
diff --git a/zshrc b/zshrc
index f410736..5385352 100644
--- a/zshrc
+++ b/zshrc
@@ -1,14 +1,24 @@
-source /cfg/zsh/zplug/init.zsh
+# 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
-zstyle ':zplug:tag' 'from' 'local'
+# directory this file is in
+CFG_DIR=$(dirname $(readlink -f ~/.zshrc))
-zplug 'zdharma/fast-syntax-highlighting'
-
-if ! zplug check --verbose; then
- printf "Install? [y/N]: "
- if read -q; then
- echo; zplug install
+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
-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)
-zplug load --verbose
+for conf in $CFG_DIR/conf.d/*(.N); do
+ source "$conf"
+done