lazy/files/zsh/00-init.zsh
Konano b93d9ab879
feat(zsh): load user config after zshrc
Load .zsh_user once before the first prompt and remove legacy direct source lines during updates. Disable Clash proxy environment variables in the default user configuration.
2026-09-08 12:03:26 +08:00

36 lines
973 B
Bash

if [ "$__ZSH_CUSTOM_INIT_INCLUDED" = "yes" ]; then
return 0
fi
__ZSH_CUSTOM_INIT_INCLUDED="yes"
# ====================================================================================================
autoload -Uz add-zsh-hook
__zsh_load_user_config() {
add-zsh-hook -d precmd __zsh_load_user_config
unfunction __zsh_load_user_config
[ -r "$HOME/.zsh_user" ] && source "$HOME/.zsh_user"
}
add-zsh-hook precmd __zsh_load_user_config
# ====================================================================================================
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