Personal zsh configuration for macOS with Oh My Zsh.
.zprofile # Homebrew bootstrap (runs at login, before .zshrc)
.zshrc # Oh My Zsh config + sources modular scripts
.zsh/
prompt.zsh # Prompt overrides (full relative path instead of dir name)
environment.zsh # LANG, EDITOR, PATH entries
gnu-utils.zsh # GNU coreutils/findutils/etc. PATH setup
asdf.zsh # asdf version manager + custom `which` extension
aliases.zsh # Custom shell aliases
brew-check.zsh # Daily Homebrew update check with upgrade prompt
Brewfile # Homebrew packages (GNU utils, git, asdf, pdm, fonts)
install.sh # Bootstrap script for a fresh machine
Clone to ~/dotfiles and run the install script:
git clone https://github.com/jpstroop/dotfiles.git ~/dotfiles
~/dotfiles/install.sh
exec zshThe install script will:
- Install Xcode Command Line Tools (if not already present)
- Install Homebrew packages from the Brewfile
- Install Oh My Zsh (if not already present)
- Symlink
.zprofile,.zshrc, and.zsh/into your home directory - Back up any existing files before overwriting
- Install asdf plugins (python, ruby), generate
.tool-versionswith latest versions on first run, and install them - Make deployed dotfiles read-only to prevent accidental edits
Homebrew itself must be installed first: https://brew.sh
GNU coreutils, findutils, grep, sed, tar, and others are more full-featured
than the BSD versions that ship with macOS. This config installs them via
Homebrew and prepends them to PATH so they take precedence.
LS_COLORS is set via dircolors for colored ls output.
Adds asdf shims to PATH and sets up completions. Extends asdf which with an
optional third argument to look up the binary path for a specific version:
asdf which python 3.7.6
# /Users/you/.asdf/installs/python/3.7.6/bin/pythonOn shell startup, if it's been more than 24 hours since the last check, runs
brew update and lists outdated packages with an interactive upgrade prompt.
Overrides the robbyrussell theme to show the full path relative to $HOME
(%~) instead of just the current directory name.
Overrides Oh My Zsh's ls alias to use GNU-compatible flags (--color=auto)
and show hidden files (-a).
The deployed copy lives at ~/dotfiles. Make changes in a separate working
copy (e.g. ~/workspace/dotfiles), then push to GitHub and pull into the
deployed copy. The install script makes deployed files read-only, so accidental
edits there will fail with a permission error.
Create a new .zsh file in the .zsh/ directory and add a source line to .zshrc:
source "${0:A:h}/.zsh/my-new-config.zsh"The ${0:A:h} pattern resolves symlinks, so source paths work whether
.zshrc is accessed directly or via the ~/.zshrc symlink.
MIT