Dotfiles
dotkit link mirrors a folder into a destination directory as symlinks. Point it at a folder of dotfiles and they land in your home directory.
Put your dotfiles in a folder:
Directorydotkit/
- mac.dotkit
Directorydotfiles/
- .zshrc
- .gitignore_global
Directory.config/
Directorynvim/
- init.lua
Then link it from your dotkit file:
dotkit link dotfilesEvery file is symlinked to the corresponding path under the destination:
.zshrc → ~/.zshrc.gitignore_global → ~/.gitignore_global.config/nvim/init.lua → ~/.config/nvim/init.luaParent directories are created automatically.
Destination
Section titled “Destination”DEST defaults to ~, which is where dotfiles go in almost every case. Pass it explicitly for anything else:
dotkit link dotfilesdotkit link dotfiles ~dotkit link etc /etcdotkit link shared ../other-machineIt may be absolute, ~/path, or relative to the source folder.
Behaviour
Section titled “Behaviour”For each file, dotkit checks what is already at the destination:
| Destination state | Action |
|---|---|
| Missing | Symlink created |
| Already correct symlink | Reported ok, skipped |
| Symlink to elsewhere | Backed up with timestamp, replaced |
| Real file | Backed up with timestamp, replaced |
Backups use the pattern filename.bak.YYYYMMDDHHMMSS. If a real file is backed up, dotkit also shows a diff so you can review what changed.
Running it twice is safe. The second run reports everything ok and changes nothing.
Previewing
Section titled “Previewing”dotkit link --dry-run dotfilesPrints what would be linked and what would be backed up, without touching anything.
Running manually
Section titled “Running manually”Re-apply symlinks at any time:
dotkit link dotfilesdotkit link ~/dotkit/dotfiles ~Excluded files
Section titled “Excluded files”*.env and *.dotkit files are never symlinked. They configure the kit rather than belonging to your home directory.
Several destinations
Section titled “Several destinations”One folder per destination, each with its own line:
Directorydotkit/
- mac.dotkit
Directorydotfiles/
Directorybase/
- …
Directorypost/
- …
dotkit link dotfiles/base---map dotkit run {{item}}
packages---dotkit link dotfiles/postHere base lands before packages are installed and post lands after, which matters for config files that a tool overwrites on first launch.
If the split gets complicated, give the folder its own dotkit file and let it describe itself:
dotkit link base ~dotkit link post ~Then the parent only needs dotkit run dotfiles.
Nested dotfiles
Section titled “Nested dotfiles”The folder structure mirrors exactly. A file at dotfiles/.config/nvim/init.lua symlinks to ~/.config/nvim/init.lua, and any missing parent directories are created.