Haoyang Xu has a really nice idea for managing your dotfiles. The idea is a generalization of using Org mode to configure Emacs, a strategy that many people have written about (here’s a pointer to a video about it). Using Org mode has the advantage that it’s easy to document your choices in a way that’s much harder to do by just adding comments. Grant Rettke has an example of this idea on steroids: he documents everything about his Emacs configuration including why he chose one configuration item over another.
Xu extends this concept to all your configuration files. You collect your configuration data in an Org file with a header for each subject area—mail, say—and have subheadings for particular dotfiles—like .mbsync
, .msmtprc
, and so on. Xu’s post has the details and some examples. He also shows how to extend the idea.
This may not be worth the trouble if you have a single machine but if you maintain two or more machines that have similar configurations, this is a real win. You can have a single (versioned) Org file that has all your configuration data, making it easy to maintain consistent configurations from a single file. Xu even shows how to configure remote machines.
I really like this idea and will probably implement it the next time I have to set up a new machine. Of course, it’s easy to start slow and keep adding additional dotfiles. That’s probably what I’ll do. When I get around to that new machine, I’ll already have my Org file ready to go and tested.