diff --git a/dot-config/zsh/all/0-zinit-module b/dot-config/zsh/all/0-zinit-module index 5d0d8e1..5ebcff5 100644 --- a/dot-config/zsh/all/0-zinit-module +++ b/dot-config/zsh/all/0-zinit-module @@ -1,6 +1,10 @@ #! zsh -ZINIT_HOME=${XDG_CACHE_HOME:-~/.cache}/zsh/zinit -if [[ -e $ZINIT_HOME/bin/zmodules/Src/zdharma/zplugin.so ]]; then - module_path+=( $ZINIT_HOME/bin/zmodules/Src ) - zmodload zdharma/zplugin +typeset -A ZINIT +ZINIT[HOME_DIR]=${XDG_CACHE_HOME:-~/.cache}/zinit +ZINIT[BIN_DIR]=${ZINIT[HOME_DIR]}/zinit.git +ZINIT[ZCOMPDUMP_PATH]=${XDG_CACHE_HOME:-~/.cache}/zsh/zcompdump + +if [[ -e ${ZINIT[HOME_DIR]}/module/Src/zdharma_continuum/zinit.so ]]; then + module_path+=( ${ZINIT[HOME_DIR]}/module/Src ) + zmodload zdharma_continuum/zinit fi diff --git a/dot-config/zsh/zinit b/dot-config/zsh/zinit index 036ca75..85c018e 100644 --- a/dot-config/zsh/zinit +++ b/dot-config/zsh/zinit @@ -1,13 +1,11 @@ #! zsh -typeset -A ZINIT -ZINIT[HOME_DIR]=$ZINIT_HOME -ZINIT[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump -if [[ ! -f $ZINIT_HOME/bin/zinit.zsh ]]; then - git clone https://github.com/zdharma-continuum/zinit $ZINIT_HOME/bin - zcompile $ZINIT_HOME/bin/zinit.zsh +[[ ! -d $ZINIT[HOME_DIR] ]] && mkdir -p $ZINIT[HOME_DIR] +if [[ ! -d $ZINIT[BIN_DIR]/.git ]]; then + git clone https://github.com/zdharma-continuum/zinit.git $ZINIT[BIN_DIR] + zcompile $ZINIT[BIN_DIR]/zinit.zsh fi -source $ZINIT_HOME/bin/zinit.zsh +source $ZINIT[BIN_DIR]/zinit.zsh load=light zinit $load willghatch/zsh-saneopt