feat: add zsh shell configuration

- Add .zshrc with custom zsh settings and plugins
- Add .zsh_aliases for zsh-specific aliases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Eric Turner
2025-08-02 20:21:45 -06:00
parent 4d67460a99
commit ab718d2cb4
2 changed files with 83 additions and 0 deletions

81
zsh/.zshrc Normal file
View File

@@ -0,0 +1,81 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-syntax-highlighting zsh-autosuggestions common-aliases docker docker-compose ansible aliases history nmap pip python rsync systemd vscode)
source $ZSH/oh-my-zsh.sh
# Source shared configurations
if [ -f ~/.dotfiles/shared/exports ]; then
source ~/.dotfiles/shared/exports
fi
if [ -f ~/.dotfiles/shared/aliases ]; then
source ~/.dotfiles/shared/aliases
fi
if [ -f ~/.dotfiles/shared/functions ]; then
source ~/.dotfiles/shared/functions
fi
if [ -f ~/.dotfiles/shared/sync ]; then
source ~/.dotfiles/shared/sync
fi
if [ -f ~/.dotfiles/shared/completions ]; then
source ~/.dotfiles/shared/completions
fi
# Zsh-specific settings
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt AUTO_CD
setopt CORRECT
setopt EXTENDED_GLOB
# Enhanced completion system
autoload -Uz compinit; compinit
autoload -Uz bashcompinit; bashcompinit
# Completion settings
zstyle ':completion:*' rehash true
# Docker completion optimization
zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes
# NVM configuration
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Source zsh-specific aliases if they exist
if [ -f ~/.dotfiles/zsh/.zsh_aliases ]; then
source ~/.dotfiles/zsh/.zsh_aliases
fi