From 5c27db0306b0dfcfde2b9d9371712132824fe30a Mon Sep 17 00:00:00 2001 From: rydesun Date: Mon, 8 Mar 2021 20:41:07 +0800 Subject: [PATCH] Update zsh: use zinit --- .config/zsh/tools/install.sh | 12 ++++++++++++ .config/zsh/tools/update.sh | 11 +++++++++++ .config/zsh/update.sh | 11 ----------- .config/zsh/zshrc | 18 +++++++++++------- 4 files changed, 34 insertions(+), 18 deletions(-) create mode 100755 .config/zsh/tools/install.sh create mode 100755 .config/zsh/tools/update.sh delete mode 100755 .config/zsh/update.sh diff --git a/.config/zsh/tools/install.sh b/.config/zsh/tools/install.sh new file mode 100755 index 0000000..eb67d61 --- /dev/null +++ b/.config/zsh/tools/install.sh @@ -0,0 +1,12 @@ +#!/bin/zsh -e + +zinit_bin_dir=${XDG_DATA_HOME:-~/.data}/zinit/bin + +if [[ -e $zinit_bin_dir ]]; then + echo Clean up old zinit bin dir. + rm -rf $zinit_bin_dir +fi + +echo Installing zinit... +git clone --depth 1 --single-branch \ + https://github.com/zdharma/zinit.git $zinit_bin_dir diff --git a/.config/zsh/tools/update.sh b/.config/zsh/tools/update.sh new file mode 100755 index 0000000..1d5c8a4 --- /dev/null +++ b/.config/zsh/tools/update.sh @@ -0,0 +1,11 @@ +#!/bin/zsh -ie + +if command -v zinit &>/dev/null; then + echo Updating plugins... + zinit update --all --parallel +else + echo zinit is missing >&2 +fi + +echo +echo Done. diff --git a/.config/zsh/update.sh b/.config/zsh/update.sh deleted file mode 100755 index 448cfca..0000000 --- a/.config/zsh/update.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/zsh -e - -if command -v antibody &>/dev/null; then - echo Updating plugins... - antibody update -else - echo antibody is missing >&2 -fi - -echo -echo Done. diff --git a/.config/zsh/zshrc b/.config/zsh/zshrc index 4750b9c..2b0fd90 100644 --- a/.config/zsh/zshrc +++ b/.config/zsh/zshrc @@ -6,13 +6,17 @@ setopt interactive_comments # 交互模式支持注释 fpath=(${ZDOTDIR}/functions ${ZDOTDIR}/Completion $fpath) # 插件 <<<------------------------------ -command -v antibody &>/dev/null && source <(antibody init) && \ -antibody bundle <