.dotfiles

Zsh Shell Configuration

Fast, modern shell setup with < 200ms startup time using Zinit and Starship.

Files

Key Features

Plugin Management

# Zinit with turbo mode (deferred plugins load after prompt)
zinit light zsh-users/zsh-completions          # Immediate (for first tab)
zinit wait lucid for fast-syntax-highlighting   # Deferred
zinit wait lucid for zsh-autosuggestions        # Deferred
zinit light agkozak/zsh-z                      # Deferred
# No OMZ plugins β€” curated aliases in aliases.zsh instead

Common Aliases

# Navigation
alias ..="cd .."
alias ls="eza --icons"

# Git
alias gs="git status"
alias gc="git commit"
alias gp="git push"

# Development
alias v="nvim"
alias py="python3"

Performance Tips

Lessons Learned

Vi Mode Recursion Fix

Both Starship and vi-mode define zle-keymap-select causing infinite recursion.

# Fix in zshrc (see the "zle-keymap-select" comment block near Starship init)
if (( ${+widgets[zle-keymap-select]} )); then
    zle -D zle-keymap-select 2>/dev/null
fi

Vi Mode Backspace Fix

Zsh vi mode binds backspace to vi-backward-delete-char, which can’t cross line boundaries or backspace past the insert-mode entry point. Fixed by binding backward-delete-char in viins:

# Fix in zshrc (see the "vi mode backspace" comment block)
bindkey -M viins '^?' backward-delete-char
bindkey -M viins '^H' backward-delete-char

This is the zsh equivalent of vim’s set backspace=indent,eol,start.

Why Not Oh-My-Zsh

Failed Approaches

Troubleshooting

Slow startup: Use zinit wait for plugins

Completions broken: Run rm -rf ~/.zcompdump* && exec zsh

Path duplicates: Add typeset -U path to zshenv

Debug: zsh -x -i -c exit 2>&1 | head -50