Personal dotfiles managed with GNU Stow for macOS. These configurations are user and machine-agnostic, using $HOME environment variable for portability.
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Stow
brew install stow-
Clone this repository:
git clone https://github.com/yourusername/dotfiles.git ~/dotfiles cd ~/dotfiles
-
Install applications via Homebrew:
brew bundle --file=_brew/Brewfile
-
Stow the configurations you want:
# Stow individual packages stow zsh stow nvim stow tmux # Or stow everything at once stow */
- zsh - Shell configuration with aliases, functions, and environment setup
- starship - Cross-shell prompt configuration
- tmux - Terminal multiplexer configuration
- ghostty - Terminal emulator settings
- warp - Modern terminal configuration
- nvim - Neovim configuration with LazyVim
- git - Git configuration and aliases
- lazygit - Terminal UI for git commands
- ssh - SSH client configuration
- vscode - VS Code settings and keybindings
- cursor - Cursor IDE configuration
- antigravity - Antigravity editor settings
- zed - Zed editor configuration
- yazi - Terminal file manager
- nap - Code snippet manager
- neofetch - System information tool
- rectangle - Window management
- aerospace - Tiling window manager
- poetry - Python dependency management configuration
# Stow a single package (creates symlinks)
stow <package-name>
# Examples:
stow zsh # Link zsh configs to $HOME
stow nvim # Link nvim configs to $HOME/.config/nvim
stow git # Link git configs to $HOME
# Stow multiple packages at once
stow zsh nvim tmux git
# Stow all packages (use with caution)
stow */# Remove symlinks for a package
stow -D <package-name>
# Examples:
stow -D zsh # Remove zsh symlinks
stow -D nvim # Remove nvim symlinks
# Unstow all packages
stow -D */# Useful after updating configs - removes old and creates new symlinks
stow -R <package-name>
# Examples:
stow -R zsh
stow -R nvim
# Restow everything
stow -R */# See what would happen without actually doing it
stow -n <package-name>
stow -nv <package-name> # Verbose output
# Examples:
stow -nv zsh # Preview zsh stow operation
stow -nv */ # Preview stowing all packages# Specify a different target directory (default: $HOME via .stowrc)
stow --target=/some/other/path <package-name>
# Verbose output (see what's being linked)
stow -v <package-name>
# Simulate (dry-run) with verbose output
stow -nv <package-name>
# Adopt existing files (move them into stow package)
stow --adopt <package-name>Some configurations may need to be machine-specific. Here's how to handle them:
Create machine-specific packages:
dotfiles/
├── tmux/ # Shared tmux config
├── tmux-work/ # Work machine specific
└── tmux-personal/ # Personal machine specific
Then stow the appropriate one:
# On work machine
stow tmux tmux-work
# On personal machine
stow tmux tmux-personalUse hostname detection in config files:
# In .zshrc or .tmux.conf
if [ "$(hostname)" = "work-machine" ]; then
# Work-specific settings
else
# Personal settings
fiKeep a base config that sources machine-specific overrides:
# In .tmux.conf
source-file ~/.tmux.conf.$(hostname)Then create:
.tmux.conf.work-machine.tmux.conf.personal-machine
Each directory represents a "stow package" and mirrors the structure from $HOME:
dotfiles/
├── zsh/
│ ├── .zshrc → $HOME/.zshrc
│ └── .zprofile → $HOME/.zprofile
├── nvim/
│ └── .config/
│ └── nvim/ → $HOME/.config/nvim/
├── tmux/
│ └── .tmux.conf → $HOME/.tmux.conf
└── git/
└── .gitconfig → $HOME/.gitconfig
Update git/.gitconfig with your personal information:
[user]
name = Your Name
email = [email protected]After stowing zsh configs:
# Reload shell configuration
source ~/.zshrc
# Or restart your terminalThe ssh/ directory contains SSH client configuration. Your actual SSH keys should be managed separately and NOT committed to the repository.
# Navigate to dotfiles directory
cd ~/dotfiles
# Pull latest changes
git pull
# Restow updated packages
stow -R <package-name>
# Or restow everything
stow -R */Before stowing, backup your existing configurations:
# Create backup directory
mkdir -p ~/.config-backup
# Backup existing configs
cp ~/.zshrc ~/.config-backup/
cp -r ~/.config/nvim ~/.config-backup/
# ... backup other configs as neededIf stow reports conflicts (existing files/symlinks):
# Option 1: Remove/backup the conflicting file manually
mv ~/.zshrc ~/.zshrc.backup
# Option 2: Use --adopt to move existing file into stow package
stow --adopt zsh
# Option 3: Force removal (careful!)
stow -D zsh # Remove old symlinks
rm ~/.zshrc # Remove conflicting file
stow zsh # Create new symlinks# Find broken symlinks in home directory
find ~ -maxdepth 1 -type l ! -exec test -e {} \; -print
# Remove broken symlink
rm <broken-symlink>
# Restow the package
stow -R <package-name># List all symlinks in your home directory
ls -la ~ | grep "^l"
# See where a specific config links to
ls -la ~/.zshrccd ~/dotfiles
brew bundle dump --force --describe --file=_brew/Brewfilecd ~/dotfiles
brew bundle --file=_brew/Brewfile# Remove packages not listed in Brewfile
brew bundle cleanup --file=_brew/Brewfile
# Do a dry run first
brew bundle cleanup --file=_brew/Brewfile --dry-runThis is a personal dotfiles repository, but feel free to fork it and adapt it to your needs!
MIT