Zsh configuration for macOS. No framework: a single .zshrc, two plugins
from Homebrew, and starship for the prompt
(see ../starship).
zsh/
└── .zshrc # All configuration
.zshrc is split into sections, loaded in this order:
- Basic options and history
- Completion (including git and Homebrew-installed tools)
- Vi mode
- Aliases
- Functions
~/.zshrc.local(if it exists)- starship
- Plugins (syntax highlighting must load last)
| Feature | How |
|---|---|
| Suggestions from history | zsh-autosuggestions, press → to accept |
| Command syntax highlighting | zsh-syntax-highlighting |
| Vi keybindings | Built-in bindkey -v; beam cursor in insert mode, block in normal mode |
| History prefix search | ↑ / ↓ in insert mode, k / j in normal mode |
| Case-insensitive menu completion | Built-in compinit |
| Name | Does |
|---|---|
vim |
nvim |
zshconfig / vimconfig |
Open the zsh / Neovim config |
cls |
clear |
.. / ... |
Go up one / two directories |
gorepo |
cd ~/repos |
g, gst, ga, gc, gco, gsw, gb, gd, gl, gp |
git, status, add, commit, checkout, switch, branch, diff, pull, push |
gtree |
git log --oneline |
showstash |
git stash list |
gitcleanup |
Fetch with prune, then delete local branches whose remote is gone. Merge detection compares patch-ids, so squash- and rebase-merged branches are recognized; branches with genuinely unmerged commits are kept and reported |
brew install zsh-autosuggestions zsh-syntax-highlighting starshipmv ~/.zshrc ~/.zshrc.backup # if one exists
ln -s ~/repos/dotfiles/zsh/.zshrc ~/.zshrc
exec zshPut anything that should not be committed (work aliases, tokens, local paths)
in ~/.zshrc.local. It lives outside the repository, so it can never be
committed by accident. .zshrc loads it if it exists.
echo 'alias gowork="cd ~/repos/work"' >> ~/.zshrc.local