Uses Git subtree and submodules to keep my dotfiles in one place in an elegant manner. With inspiration from xero, uses GNU Stow to symlink files one folder deep to the folder above.
These settings sync across machines. Some configurations guard optional tools that may not be installed everywhere.
This is the third generation of my dotfiles management system. It is a weird hobby of mine, but I am not alone! The others hang out at vcs-home.
Other tools to install:
Bash's ~/.config/bash/env.bash and Zsh's ~/.zshenv both load
~/.config/shell/env.sh. It adds existing tool directories, including the
SDK launcher in ~/.dotnet and global tools in ~/.dotnet/tools, without
starting subprocesses or loading prompts, completion, or version-manager
hooks. Inherited system PATH ordering is preserved, with Homebrew promoted
to the front. Install the new shared shell package with ./install.sh
from the canonical checkout before starting a new shell.
uv, code, and pwsh use their installed launchers in standard PATH
directories such as /opt/homebrew/bin and /usr/local/bin; startup does
not add Poetry's old directory or application-internal launcher directories.
Bash still provides path_front dir... and path_back dir...; quote
directory names containing spaces. Zsh also keeps its unique, PATH-linked
path array, so path=("$HOME/bin" $path) and path+=("$HOME/tools") work
as before.
Noninteractive Bash does not read .bashrc. Shared startup exports
BASH_ENV="$HOME/.config/bash/env.bash" so descendant Bash command runners
load the same setup. This entrypoint is safe to source repeatedly. Apps
launched outside an initialized shell must arrange to source it themselves
or inherit that variable; already-running apps need a fresh environment.
Put shared machine-local settings in ~/.local/share/shell/env.sh, using
Bash/Zsh-compatible builtins. Existing ~/.local/share/bash/env.bash and
~/.local/share/zsh/env.zsh hooks still load afterward for shell-specific
settings. Keep all these hooks free of subprocesses.
Run the shell behavior suite with python3 -m unittest discover -s tests.
The installer installs two complementary plugins when Homebrew is available, skipping each one if already installed:
./install.sh- zsh-autocomplete automatically shows completion menus for commands, options, and paths. Press Tab to insert the first completion, Down Arrow to browse the menu, or Up Arrow to search history.
- zsh-autosuggestions
shows gray inline suggestions from shell history, such as
brew update && brew upgrade. Press Right Arrow at the end of the line to accept one, or keep typing to ignore it.
cd commands are excluded from gray history suggestions, so directory
navigation uses completion in the current location instead of replaying
paths from somewhere else. Both plugins run locally; neither uses an AI
service or credits.
.zshrc loads autocomplete first and lets it initialize Zsh's completion
system, then loads autosuggestions with history-only suggestions. Each
plugin is optional; without autocomplete, .zshrc initializes normal Tab
completion instead. Autocomplete's recent directories are stored under
${XDG_DATA_HOME:-$HOME/.local/share}/zsh.
On a Mac with Homebrew under /opt/homebrew, the installer loads
local.upgradebrew, a launch agent that runs brew upgrade --no-ask daily at
10 AM, or on the next wake if the Mac was asleep, logging to
~/Library/Logs/upgrade-brew.log. launchd can't expand ~ in a plist, so
install.sh writes launchd/local.upgradebrew.plist
into ~/Library/LaunchAgents with the home directory filled in; rerun it
after editing the template.
Yes, I use much of this on Windows too (I work at Microsoft after all).
But instead of using GNU Stow, I just load things from stubs.
Usually I clone this repo to ~/src/dotfiles because Windows is messy.
In $PROFILE.CurrentUserAllHosts:
. ~/src/dotfiles/powershell/.config/powershell/profile.ps1In ~/.gitconfig:
[include]
path = src/dotfiles/git/.config/git/config
Previously I have used freshrc to manage my dotfiles (the history of which
is in the shell subtree). It was too complicated. Then I switched to a
combination of vcsh and myrepos, which added a lot of overhead.
Specifically, I did not like that the files didn't exist in a Git repository,
which broke VCS integration with my editors. After an erroneous vcsh foreach git fetch was auto-corrected to vcsh foreach init and broke my local repos,
I realized I needed just one repo.
I've also swapped between both Vim and Emacs several times. If I remember correctly, I started with Vim, was convinced to try Emacs by my mentor, fell in love with Elisp, never quite liked the key-chording and went back to Vim, hated VimL, used Spacemacs for a time, and now have taken to using my own integrations of Evil (Vim-mode) with Emacs.
I still recommend Spacemacs to new users, as it's the best of both worlds. I just found the one-size-fits-all approach too clunky for me, since I heavily customize my editor anyway.