Personal dotfiles managed with GNU Stow.
This repository uses GNU Stow to manage symlinks. All dotfiles are in the dotfiles/ package directory:
dotfiles/.config/nvim/- Neovim configurationdotfiles/.config/tmux/- Tmux configurationdotfiles/.config/ghostty/- Ghostty terminal configurationdotfiles/.config/hive/- Hive configurationdotfiles/.config/zls.json- Zig Language Server configurationdotfiles/.local/bin/- Custom scriptsdotfiles/.zshrc- Zsh configuration (merged macOS/Linux with OS detection)dotfiles/.wezterm.lua- WezTerm terminal configurationdotfiles/.ideavimrc- IntelliJ IDEA Vim plugin configurationdotfiles/.vsvimrc- Visual Studio Vim configuration
macOS:
brew install stowLinux (Debian/Ubuntu):
sudo apt install stowLinux (Arch):
sudo pacman -S stow-
Clone this repository:
git clone https://github.com/yourusername/dotfiles.git ~/Code/dotfiles cd ~/Code/dotfiles
-
(Optional) Install Zsh dependencies:
./install-zsh-deps.sh
This installs Oh My Zsh, Powerlevel10k, and required zsh plugins.
-
Remove existing configs that conflict:
# Backup your current configs if needed mv ~/.zshrc ~/.zshrc.backup rm ~/.config/nvim # if it's a symlink # etc.
-
Install dotfiles using GNU Stow:
stow dotfiles
This will symlink all dotfiles from the
dotfiles/directory to your home directory. -
Reload your shell:
source ~/.zshrc
GNU Stow creates symlinks from the dotfiles repo to your home directory. For example:
~/Code/dotfiles/.config/nvim/init.lua → ~/.config/nvim/init.lua
~/Code/dotfiles/.zshrc → ~/.zshrc
~/Code/dotfiles/.config/tmux/tmux.conf → ~/.config/tmux/tmux.conf
cd ~/Code/dotfiles
stow dotfilescd ~/Code/dotfiles
stow -D dotfilescd ~/Code/dotfiles
stow -R dotfilesstow -n dotfilesstow -v dotfilesThe .zshrc file includes OS detection via $OSTYPE:
- macOS-specific configs (Homebrew, Bun, Android Studio, etc.) only load on macOS
- Shared configs (aliases, Go, vim, etc.) work on both platforms
- Linux-specific configs can be added in the
elsebranch
Create ~/.zshrc.local for machine-specific configurations (API keys, local paths, etc.). This file is gitignored and sourced automatically.
If stow reports conflicts (files already exist), you have a few options:
-
Backup and remove existing files:
mv ~/.zshrc ~/.zshrc.backup stow zsh
-
Adopt existing files into stow:
stow --adopt zsh
Note: This will move existing files into your dotfiles repo. Review changes before committing.
find ~ -maxdepth 1 -type l ! -exec test -e {} \; -delete- Mirror your home directory structure in the
dotfiles/package - Move your dotfile into the package
- Restow
Example for adding a new config:
cd ~/Code/dotfiles
mkdir -p dotfiles/.config/myapp
mv ~/.config/myapp/config dotfiles/.config/myapp/config
stow -R dotfiles- Edit files in the
dotfiles/package (they're symlinked, so edits apply immediately) - Commit and push changes
- On other machines:
git pull && stow -R dotfiles