1
0
Fork 0
chezmoi/dot_config/zsh/init.zsh
2025-04-28 22:19:46 +02:00

47 lines
1.3 KiB
Bash

cachedir=${XDG_CACHE_HOME:-$HOME/.cache}/zsh
datadir=${XDG_DATA_HOME:-$HOME/.local/share}/zsh
test -d $cachedir || mkdir -p $cachedir
test -d $datadir || mkdir -p $datadir
source $ZSH_CONFIG_DIR/env.zsh
source $ZSH_CONFIG_DIR/options.zsh
source $ZSH_CONFIG_DIR/input.zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ${ZDOTDIR:-${HOME}}/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${cachedir}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${cachedir}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
ZIM_HOME=$datadir/zim
ZIM_CONFIG_FILE=$ZSH_CONFIG_DIR/zimrc
test -d $ZIM_HOME || mkdir -p $ZIM_HOME
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
wget -O ${ZIM_HOME}/zimfw.zsh \
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
fi
if [[ ! ${ZIM_HOME}/init.zsh -nt $ZIM_CONFIG_FILE ]]; then
source ${ZIM_HOME}/zimfw.zsh init -v
fi
source ${ZIM_HOME}/init.zsh
for cf in $ZSH_CONFIG_DIR/include/*.zsh ; do
source $cf
done
if [[ $ZSH_CONFIG_DIR/theme/gruvbox.ini -nt $(fast-theme -w && pwd )/current_theme.zsh ]]
then
echo "Refreshing theme"
fast-theme $ZSH_CONFIG_DIR/theme/gruvbox.ini
fi
unset _fast_theme
if (( ${+ZIM_UPDATE} ))
then
zimfw update -v
fi
unset cachedir datadir