experimental: zsh_init

This commit is contained in:
Konano 2023-11-30 11:47:39 +08:00
parent ecb11110c6
commit 26b960c63a
4 changed files with 26 additions and 3 deletions

17
files/zsh/.zsh_init Normal file
View File

@ -0,0 +1,17 @@
ZSH_THEME="ys-simple"
zstyle ':omz:update' mode reminder # just remind me to update when it's time
zstyle ':omz:update' frequency 13
plugins=(git)
plugins+=(git-open autojump zsh-autosuggestions zsh-syntax-highlighting sudo)
plugins+=(history encode64 tmux)
plugins+=(dirhistory jsontools)
dependent_plugins() {
if command -v "$@" >/dev/null 2>&1; then plugins+=("$@"); fi
}
dependent_plugins docker-compose
dependent_plugins fzf

View File

@ -102,8 +102,14 @@ configure_zsh() {
git_clone paulirish/git-open ~/.oh-my-zsh/custom/plugins/git-open --norecursive
sudo apt install autojump -y
# cp $scriptdir/files/.zshrc ~/.zshrc
cp $scriptdir/files/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/ys-simple.zsh-theme
cp $scriptdir/files/zsh/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/ys-simple.zsh-theme
if ! grep -Fxq "source ~/.zsh_init" ~/.zshrc; then
local line_number=$(grep -n "source \$ZSH/oh-my-zsh.sh" .zshrc | cut -d : -f 1)
sed -i "${line_number}i source ~/.zsh_init\n" .zshrc
fi
cp $scriptdir/files/zsh/.zsh_init ~/.zsh_init
fi
}

View File

@ -78,7 +78,7 @@ configure_nodejs() {
# ============================================================
update_file $scriptdir/files/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/ys-simple.zsh-theme
update_file $scriptdir/files/zsh/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/ys-simple.zsh-theme
# update_file $scriptdir/files/.user_utils ~/.user_utils
update_authorized_keys