diff --git a/files/zsh/.zsh_init b/files/zsh/.zsh_init new file mode 100644 index 0000000..7095304 --- /dev/null +++ b/files/zsh/.zsh_init @@ -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 diff --git a/files/ys-simple.zsh-theme b/files/zsh/ys-simple.zsh-theme similarity index 100% rename from files/ys-simple.zsh-theme rename to files/zsh/ys-simple.zsh-theme diff --git a/init_priv.sh b/init_priv.sh index fc14bba..c87a1aa 100755 --- a/init_priv.sh +++ b/init_priv.sh @@ -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 } diff --git a/init_user.sh b/init_user.sh index 045e52c..715a4a0 100755 --- a/init_user.sh +++ b/init_user.sh @@ -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