dotfiles/.zshrc
2026-04-02 22:20:45 -04:00

59 lines
3.1 KiB
Bash

# Enable Powerlevel10k instant prompt. Must stay at the top of ~/.zshrc.
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
# ── Oh My Zsh ──────────────────────────────────────────────────────────────────
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Custom plugins require manual install — see comments below.
plugins=(
git
docker
docker-compose
kubectl
terraform
aws
pyenv
z # jump to frecent dirs (built-in omz plugin)
macos
zsh-autosuggestions # git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh-syntax-highlighting # git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# ── Aliases ────────────────────────────────────────────────────────────────────
[[ -f ~/.aliases ]] && source ~/.aliases
# ── pyenv ──────────────────────────────────────────────────────────────────────
if command -v pyenv &>/dev/null; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi
# ── History ────────────────────────────────────────────────────────────────────
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
# ── Completion ─────────────────────────────────────────────────────────────────
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # case-insensitive
# ── kubectl autocomplete ───────────────────────────────────────────────────────
if command -v kubectl &>/dev/null; then
source <(kubectl completion zsh)
fi
# ── AWS CLI autocomplete ───────────────────────────────────────────────────────
if command -v aws_completer &>/dev/null; then
autoload bashcompinit && bashcompinit
complete -C aws_completer aws
fi
# ── Powerlevel10k ──────────────────────────────────────────────────────────────
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh