Manage Dotfiles with stow
For many years i had been using a git repo inside my home folder to manage my dotfiles. Keeping them up to date and syncing them over multiple machine was very easy this way. Also using a gitignore file with a wildcard made it possible that git interactions weren’t to noisy. But in recent years all kinds of shell extension like starship or powerlevel10k like to gather the git status on each shell interaction which is handy but also made things sometime slower than they should, if your home folder is a git repo.
Recently i switched to stow which allows me to keep all my dotfile i one folder away from my home folder.
So lets a assume a folder dotfiles
some in your filesystem. I group my dotfiles into subfolders.
dotfiles
tmux
.tmux.conf
zsh
.zsh
aliases
env
.zshrc
Inside the dotfiles
folder i have a Makefile that helps me to use stow.
all:
stow -vv --target=$$HOME tmux
stow -vv --target=$$HOME zsh
Using stowing like this, it will create symlinks for all the dotfiles into my home folder. Using the $$HOME Makefile enviroment variable, makes it possible to use the Makefile on MacOS and Linux, where home location path differ.
My home folder looks like this then
lrwxr-xr-x david staff 32 B Tue Apr 11 12:58:41 2023 .tmux.conf -> dotfiles/tmux/.tmux.conf
Manage Dotfiles with stow Read More ยป