Monolithic dotfiles or portable dotfiles?

Last edited: 2nd January 2024

Just a few months ago, I have been working on my configuration files, also known as dotfiles. You can find them here.

While working on these config files, I have taken a look at other people's dotfiles, and I noticed a pattern of how people organise their dotfiles, which there are two ways of going for it, and I have given them the following terms: Portable dotfiles and monolithic dotfiles.

Portable dotfiles consist of one config file per application, hence why I consider calling them "portable" as they are just one file that you can easily use on another. Most software that actually uses a config file comes with just one config file.

However, some people have their config files split up into multiple files for one program. For example, people have separated their Neovim config files into one file for keybindings, one for plugins, and one for setting variables. I have started to refer such as monolithic dotfiles because multiple files are required for the dotfiles to work as intended.

Now comes the question which design choice for your config files is better.

If you have a really large config file where you change every single pattern that there is, then splitting it up into multiple files might be a better option since the large config file after a few hundred get really hard to read. Just be sure to correctly organise it correctly.

However, from my personal experience, portable dotfiles have been a much better experience to deploy and to configure. Whenever I tried some dotfiles out from other users, which were monolithic, I came across many different kinds of errors just because their config files required so many other config files. Also, when I tried to separate my Neovim config file for example, it was a huge pain to do so, and it was a bit janky after some time. What I did is I just wasted time, but that's rather my fault, however, after trying it out once, I have come to such a conclusion, especially when you factor in the size of my config files. I don't have config files that have 150+ lines, heck, some even go below 100 lines, which is why I have been prefering portable config files over monolithic dotfiles.

However, it all comes down to personal preference at the end :)