diff --git a/configs/zim+/setup b/configs/zim+/setup index 377d831..0efbf59 100755 --- a/configs/zim+/setup +++ b/configs/zim+/setup @@ -3,16 +3,3 @@ emulate -L zsh -o err_return cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ - -git clone -q --depth=1 https://github.com/zimfw/install.git ~/install -git clone -q --depth=1 https://github.com/zimfw/zimfw.git ~/.zim - -() { - local rc - for rc in zshenv zshrc zlogin; do - <~/install/src/templates/$rc >>~/.$rc - done -} - -rm -rf -- ~/install -zsh ~/.zim/zimfw.zsh install >/dev/null diff --git a/configs/zim+/skel/.zimrc b/configs/zim+/skel/.zimrc index 429bf9f..0726804 100644 --- a/configs/zim+/skel/.zimrc +++ b/configs/zim+/skel/.zimrc @@ -1,4 +1,4 @@ zmodule completion -zmodule romkatv/powerlevel10k -zmodule zsh-users/zsh-autosuggestions zmodule zsh-users/zsh-syntax-highlighting +zmodule zsh-users/zsh-autosuggestions +zmodule romkatv/powerlevel10k diff --git a/configs/zim+/skel/.zshenv b/configs/zim+/skel/.zshenv index 7010f80..c6ef435 100644 --- a/configs/zim+/skel/.zshenv +++ b/configs/zim+/skel/.zshenv @@ -1 +1,4 @@ setopt no_global_rcs + +# Define Zim location +ZIM_HOME=~/.zim diff --git a/configs/zim+/skel/.zshrc b/configs/zim+/skel/.zshrc index 2c51c6e..4b51ed1 100644 --- a/configs/zim+/skel/.zshrc +++ b/configs/zim+/skel/.zshrc @@ -1,10 +1,25 @@ +# If not in tmux, start tmux. if [[ -z ${TMUX+X}${ZSH_SCRIPT+X}${ZSH_EXECUTION_STRING+X} ]]; then exec tmux fi +if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then + # Download zimfw script if missing. + command curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh +fi +if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then + # Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated. + source ${ZIM_HOME}/zimfw.zsh init -q +fi + +# Activate Powerlevel10k Instant Prompt. if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi ZSH_AUTOSUGGEST_MANUAL_REBIND=1 + +# Load plugins. +source ${ZIM_HOME}/init.zsh + source ~/.p10k.zsh