29 lines
901 B
Bash
29 lines
901 B
Bash
# Set the directory we want to store zinit and plugins
|
|
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
|
CONFIG_DIR="$HOME/.config/zsh"
|
|
|
|
# Download Zinit, if it's not there yet
|
|
if [ ! -d "$ZINIT_HOME" ]; then
|
|
mkdir -p "$(dirname $ZINIT_HOME)"
|
|
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
|
fi
|
|
|
|
# Source/Load zinit
|
|
source "${ZINIT_HOME}/zinit.zsh"
|
|
|
|
# Load plugins
|
|
[[ ! -f $CONFIG_DIR/plugins.zsh ]] || source $CONFIG_DIR/plugins.zsh
|
|
|
|
# Load aliases
|
|
[[ ! -f $CONFIG_DIR/alias.zsh ]] || source $CONFIG_DIR/alias.zsh
|
|
[[ ! -f $CONFIG_DIR/env.zsh ]] || source $CONFIG_DIR/env.zsh
|
|
[[ ! -f $CONFIG_DIR/nvm.zsh ]] || source $CONFIG_DIR/nvm.zsh
|
|
[[ ! -f $CONFIG_DIR/pnpm.zsh ]] || source $CONFIG_DIR/pnpm.zsh
|
|
[[ ! -f $CONFIG_DIR/sdkman.zsh ]] || source $CONFIG_DIR/sdkman.zsh
|
|
|
|
# Load completions
|
|
autoload -Uz compinit && compinit
|
|
|
|
zinit cdreplay -q
|
|
|