No description
- Shell 69.9%
- Lua 28.2%
- Python 1.9%
Dotfiles
Personal macOS configuration managed with GNU Stow.
Included Packages
- zsh - Zsh configuration with oh-my-zsh
- starship - Starship prompt with Catppuccin Powerline preset
- nvim - Neovim configuration
- ghostty - Ghostty terminal configuration
- zed - Zed editor configuration
- ripgrep - ripgrep configuration (
~/.ripgreprc) - linearmouse - LinearMouse configuration
- brew - Brewfile for application management
- scripts - Custom shell scripts (
~/.local/bin) - flameshot - Flameshot configuration
- topgrade - Topgrade configuration
- sketchybar - Floating island status bar with yabai integration
- cron - Automated task scheduling
Quick Installation
On a New Machine
# Clone this repository
git clone https://github.com/mrcalexandre/dotfiles.git ~/Code/dotfiles
cd ~/Code/dotfiles
# Run automatic installation
./install.sh
The install.sh script will:
- Install Homebrew if needed
- Install GNU Stow
- Install oh-my-zsh and its plugins
- Backup my existing files
- Create symlinks with Stow
- Install all applications from Brewfile
On an Existing Machine (Migration)
cd ~/Code/dotfiles
# 1. First commit all my files in the repo
git add .
git commit -m "Add initial dotfiles"
git push
# 2. Create symlinks (automatic backup of my current files)
./setup-symlinks.sh
How Does It Work?
GNU Stow creates symlinks from this repository to my home directory. The .stowrc file sets --target=~ so every package is stowed with a single command regardless of whether it targets ~/ or ~/.config/:
~/Code/dotfiles/zsh/.zshrc → ~/.zshrc
~/Code/dotfiles/starship/.config/starship.toml → ~/.config/starship.toml
~/Code/dotfiles/nvim/.config/nvim/init.lua → ~/.config/nvim/init.lua
~/Code/dotfiles/ghostty/.config/ghostty/config → ~/.config/ghostty/config
Advantage: When I modify ~/.zshrc or ~/.config/nvim/init.lua, I am actually modifying files in the repo — changes are automatically versioned and easy to sync between machines via Git.
Sync on Another Machine
cd ~/Code/dotfiles
git pull
stow zsh starship nvim ghostty zed sketchybar
Adding a New Package
- Create the directory structure inside the repo, mirroring the path relative to
~:
# For a file that lives at ~/.config/bat/config
mkdir -p bat/.config/bat
- Move the existing config file into it:
mv ~/.config/bat/config bat/.config/bat/config
- Stow the package:
stow bat
Stow will refuse if a file already exists at the target path — move or delete the original first (step 2 handles this).
Useful Commands
# Stow a package
stow zsh
stow nvim
stow ghostty
# Stow all packages
stow zsh starship brew scripts nvim flameshot topgrade ghostty zed ripgrep linearmouse sketchybar
# Unstow (remove symlinks)
stow -D zsh
stow -D nvim
# Re-stow (useful after modifications)
stow -R zsh
stow -R nvim
# Simulate without doing anything (dry-run)
stow -n -v zsh
stow -n -v nvim
Zsh Configuration
My Zsh configuration uses:
- oh-my-zsh - Zsh framework
- Starship - Cross-shell prompt with Catppuccin Powerline preset
- zsh-autosuggestions - History-based suggestions
- zsh-syntax-highlighting - Syntax highlighting
- you-should-use - Available alias reminders
Plugins
git- Git aliaseszoxide- Smart navigation (replaces cd)
Installed Applications
See the brew/.Brewfile file for the complete list.
Troubleshooting
Conflicts During Stow
# Error: "File already exists"
# Solution: remove the existing file or make a backup
mv ~/.zshrc ~/.zshrc.backup
stow zsh
Check Symlinks
# See where a symlink points
ls -la ~/.zshrc
# Expected result:
# ~/.zshrc -> /Users/alexandre/Code/dotfiles/zsh/.zshrc
Restore a Backup
# Backups are in ~/.dotfiles_backup_YYYYMMDD_HHMMSS/
ls -la ~/.dotfiles_backup_*
# Restore
cp ~/.dotfiles_backup_20241022_163000/.zshrc ~/