Why bother?
My old dotfiles were a graveyard of configs I no longer understood. Half the aliases were for tools I had stopped using. The neovim config had plugins that conflicted with each other.
Starting fresh is terrifying and liberating at the same time.
The structure I landed on
~/.dotfiles/
install.sh ← single entry point
zsh/
.zshrc
aliases.zsh
exports.zsh
tmux/
.tmux.conf
nvim/
init.lua
lua/
plugins/
The bootstrap script
The install script does four things:
- Symlinks every config file to its expected location
- Installs Homebrew packages from a
Brewfile - Sets up Oh My Zsh and plugins
- Runs
nvim --headless +PlugInstall +qa
#!/usr/bin/env bash
set -e
DOTFILES="$HOME/.dotfiles"
# Symlinks
ln -sf "$DOTFILES/zsh/.zshrc" "$HOME/.zshrc"
ln -sf "$DOTFILES/tmux/.tmux.conf" "$HOME/.tmux.conf"
ln -sf "$DOTFILES/nvim" "$HOME/.config/nvim"
# Packages
brew bundle --file="$DOTFILES/Brewfile"
What I would do differently
Version-pinning Homebrew packages is harder than it sounds. I now keep a Brewfile.lock.json in the repo to avoid surprise upgrades breaking my terminal.
The result
A new machine goes from zero to fully configured in about 8 minutes. That peace of mind is worth the weekend it took to get here.