From b2bf9b7a2d72f91d75f2222a70d54eaeb8b04d61 Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Mon, 15 May 2017 14:28:36 +0200 Subject: Ditch zplug for manual management --- zshrc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'zshrc') 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 -- cgit v1.2.3