1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 20:01:49 +08:00

Update Zsh Home dir to XDG standard

This commit is contained in:
juan 2022-04-16 19:18:52 +08:00
parent 641645f1f2
commit 58d208c204

5
.zshrc
View File

@ -4,14 +4,15 @@ echo '\033[0;35m /w '$(awk -F "=" '/^NAME/ {print $2}' < /etc/os-release )
echo '\033[0;34m @ '$HOST
#Install zinit if no zinit is present
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
if [[ ! -f $ZINIT_HOME/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
source "$ZINIT_HOME/zinit.zsh"
zinit ice lucid wait
zinit light zdharma-continuum/fast-syntax-highlighting