Tuesday, December 23, 2025
My dotfiles
One person expressed interest in my dotfiles and I have decided to share more details. I do it for 7 years (even to my surprise) so it looks like it is reliable and solid method.
What AI suggests
Just to check if I am up to date I have asked AI for some insights. Here is what I got as an answer:
People manage dotfiles (configuration files for tools like shells, editors, git, etc.) in various ways, but here are the most common approaches and best practices:
Version control with Git is the foundation. Most people create a dedicated repository to track their dotfiles, which provides history, backup, and easy syncing across machines.
Common organizational strategies:
-
The simplest approach is storing dotfiles in a dedicated directory (like ~/dotfiles) and creating symlinks to their expected locations in your home directory. You can automate this with a simple script or Makefile.
-
Some people use specialized tools like GNU Stow, which manages symlinks elegantly by treating your dotfiles directory as a package repository. Others use dedicated dotfile managers like chezmoi, yadm, or rcm that handle more complex scenarios like templating and machine-specific configurations.
-
A clever alternative is the “bare repository” method, where you initialize a bare git repo and set your home directory as the working tree, eliminating the need for symlinks entirely.
Keep sensitive information out of your dotfiles.
Why?
Main benefits for me in practice:
-
Relatively quick setup on new machine
-
Sync between different machines (e.g. if I add new plugin to Neovim it is available on all machines)
-
History is useful sometimes as well, e.g. if I want to return to old plugin and I had custom configuration for it.
-
You can give link to GitHub to other people for them to checkout how it is done.
Side benefits:
- There are services that scan dotfiles and make statistics about popular practices, tools or plugins.
How?
My dotfiles are here https://github.com/daliusd/cfg/. You can quickly see that
I use bare git repository and I have alias cfg in my shell:
https://github.com/daliusd/cfg/blob/master/.config/fish/config.fish#L12-L14
In practise that means that I usually use those commands:
cfg diff
cfg diff --staged
cfg add -u
cfg add specific_file_or_folder
cfg push
cfg pull
Basically instead of git I use cfg and use git commands. Fish shell is
smart enough to figure out that cfg is git alias and suggests
auto-completions. It is very simply system and this is what makes it work.
Do I need machine-specific configuration?
Sometimes I do and there are many
ways how to achieve that without templating or special tools. Check uname
usage in my config.fish for some ideas:
https://github.com/daliusd/cfg/blob/master/.config/fish/config.fish
What about passwords and other sensitive information?
I use pass to keep my passwords, secrets and
other sensitive information. I use different repository to keep the secrets and
if I need to reference secret in my dotfiles I can use pass whatever safely.
That’s it. Happy usage.