52 lines
2.8 KiB
Plaintext
52 lines
2.8 KiB
Plaintext
# ════════════════════════════════════════════════════════════
|
|
# Ada's Modular ZSH Configuration
|
|
# ════════════════════════════════════════════════════════════
|
|
|
|
# ═══ Fastfetch ══════════════════════════════════════════════
|
|
if [[ -o interactive && -z "$TMUX" && -n "$KITTY_WINDOW_ID" ]] && command -v fastfetch &>/dev/null; then
|
|
fastfetch
|
|
fi
|
|
|
|
# ═══ Powerlevel10k Instant Prompt ══════════════════════════
|
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
fi
|
|
|
|
# ═══ Zinit (Plugin Manager) ════════════════════════════════
|
|
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
|
if [[ ! -d "$ZINIT_HOME" ]]; then
|
|
print -P "%F{blue}▓▒░ Установка zinit...%f"
|
|
mkdir -p "$(dirname $ZINIT_HOME)"
|
|
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
|
fi
|
|
source "${ZINIT_HOME}/zinit.zsh"
|
|
|
|
# ═══ Загрузка модулей ══════════════════════════════════════
|
|
ZSH_CONFIG_DIR="${ZDOTDIR}/config"
|
|
source "${ZSH_CONFIG_DIR}/env.zsh"
|
|
source "${ZSH_CONFIG_DIR}/options.zsh"
|
|
source "${ZSH_CONFIG_DIR}/plugins.zsh"
|
|
source "${ZSH_CONFIG_DIR}/completion.zsh"
|
|
source "${ZSH_CONFIG_DIR}/aliases.zsh"
|
|
source "${ZSH_CONFIG_DIR}/functions.zsh"
|
|
source "${ZSH_CONFIG_DIR}/keybindings.zsh"
|
|
source "${ZSH_CONFIG_DIR}/prompt.zsh"
|
|
|
|
# ═══ Локальные настройки ═══════════════════════════════════
|
|
[[ -f "${ZSH_CONFIG_DIR}/local.zsh" ]] && source "${ZSH_CONFIG_DIR}/local.zsh"
|
|
|
|
[[ -f "${ZDOTDIR}/.p10k.zsh" ]] && source "${ZDOTDIR}/.p10k.zsh"
|
|
|
|
autoload -Uz add-zsh-hook
|
|
|
|
# ═══ Напоминания ════════════════════════════════════════════
|
|
# Запускаем после первого промпта, чтобы не конфликтовать с p10k instant prompt
|
|
if (( ${+functions[_backup_reminder]} )); then
|
|
_precmd_backup_reminder() {
|
|
_backup_reminder
|
|
add-zsh-hook -d precmd _precmd_backup_reminder
|
|
unfunction _precmd_backup_reminder
|
|
}
|
|
add-zsh-hook precmd _precmd_backup_reminder
|
|
fi
|