From ab718d2cb4098ca369fc01140fd575a96c231a91 Mon Sep 17 00:00:00 2001 From: Eric Turner Date: Sat, 2 Aug 2025 20:21:45 -0600 Subject: [PATCH] feat: add zsh shell configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- zsh/.zsh_aliases | 2 ++ zsh/.zshrc | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 zsh/.zsh_aliases create mode 100644 zsh/.zshrc diff --git a/zsh/.zsh_aliases b/zsh/.zsh_aliases new file mode 100644 index 0000000..487a02a --- /dev/null +++ b/zsh/.zsh_aliases @@ -0,0 +1,2 @@ +# Zsh-specific aliases +# Add zsh-only aliases here if needed \ No newline at end of file diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..c0dd578 --- /dev/null +++ b/zsh/.zshrc @@ -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 +