This repository contains my dotfiles, making it easier to manage and version-control them across different systems. It is organised for use with GNU Stow, a symlink manager. The blog post Using GNU Stow to manage your dotfiles does an excellent of job explaining this approach.
The structure of this repository is:
- Each top-level directory is a package: These directories correspond to individual applications or sets of related configuration files.
- Subdirectories mimic the target directory structure: Inside each package, the directory structure should match where the files will be placed on the target system.
The table below shows how GNU Stow maps dotfiles to their corresponding locations in the GNU Stow directory structure. The arrows indicate the transformation from the original dotfile location to the GNU Stow convention.
Dotfile | GNU Stow Path | |
---|---|---|
~/.config/nvim |
→ | nvim/.config/nvim |
~/.config/alacritty |
→ | alacritty/.config/alacritty |
~/.zshrc |
→ | zsh/.zshrc |
Ensure you have GNU Stow installed. You can install it via Homebrew on macOS:
brew install stow
- Clone the repository to your home directory:
git clone [email protected]:bclews/dotfiles.git ~/dotfiles
- Navigate to the
dotfiles
directory:
cd ~/dotfiles
- Use GNU Stow to create symlinks for the desired configuration packages. For example:
stow alacritty
stow bat
stow btop
stow neofetch
stow nvim
This will create symlinks in the appropriate locations (e.g., ~/.config/alacritty
).
A Makefile
is provided for convenience. You can use it to stow and unstow all configurations at once.
- Stow all configurations:
make stow
- Unstow all configurations:
make unstow
- Show help message:
make help
To add a new configuration:
- Create a new directory for the application inside the
dotfiles
directory. - Add the configuration files, ensuring the directory structure matches the target location.
- Use
stow
to create symlinks for the new configuration.