Overhaul of my dotfiles
2025-10-27 15:22:02 +01:00 by Mark Smith
I did an overhaul of my dotfiles!
For those of you not familiar with the concept of dotfiles, how to explain them? Well on linux/unix systems many applications store their user settings inside 'dot' files and / or folders. These are files who’s filename starts with a dot, for example .bashrc, .bash_profile, or .vimrc. The reason for this is that by default when you list a folder's contents, the items that start with a dot are not listed. This keeps things uncluttered, because most of the time you don’t need to be seeing these files.
Since programmers typically use a lot of different software tools, in a variety of ways and on a variety of different systems, it’s worth spending the time to get good at organising these files. Hence the idea of dotfiles, which are collections of dot files that are organised in such a way that you can easily make changes to them and deploy them onto different systems. Typically via git, with them all stored in a git repository like on Github. People get very carried away with them. Check out awesome dotfiles for some idea.
The thing is, as awesome as they are, it’s all too easy to fall down a very big rabbit hole. That’s what had happened to me with my first attempt. I figured it would be great to use my dotfiles to install and configure the entire system, and it would have been, but the reality is that system installation is something most of us do so infrequently, that these complicated setups rapidly get out of date, and they are so tedious and annoying to test, that in practice they just gather dust and you get more and more scarred to touch them because you can't remember all the reasons you made them the way you made them, and they just become a thing that you open up every now and then, start panicking and quickly close and move onto something else.
The thing is though, they are quite important, because when you do have to setup a new system, you either use them or you have to do the whole thing from scratch, which is also a total pain. A few days ago, hot off the back of several small overhaul successes, I decided to give it another go. Surely there was a middle ground between automated install of the entire universe and do everything manually?
As it happens I did recently have to install everything again from scratch, first my Android phone, and then my new mac laptop. When I did that I basically started with a fresh empty config and just added the minimum I needed as I went along. It has been working quite well, but a bit disorganised and also lots of annoying copy and pasting, via email, between both devices. They share a lot of configuration but there are also notable platform specific differences. The biggest insight I had before embarking on this overhaul was that all the fancy installation scripts were totally unnecessary. In the event of re-installation, I'm okay doing that by hand. But the one thing I really do rely on day to day is my bash shell configuration. All the aliases, exported environment variables, shell functions and bash scripts. I use many of these every single day.
With that in mind I asked Gemini what suggestions it had for structuring my dotfiles to do just that, and only that, nothing too fancy. I'm very glad I asked because the response I got back was formidable. In seconds Gemini cut through years of cruft and tangled code, suggesting a very clear and simple structure, and within a few hours working together we were able to come up with a setup that incorporated all my current configuration, while adding lots of very useful things that I wouldn’t have thought of. Now I don’t claim these are the best dotfiles ever, I was mainly trying to replicate the setup that I had developed over time, there are likely refinements that I will make over the next few months, but I’m pretty happy with it so far.
I’m still somewhat surprised it was that easy, and both laptop and android phone have been updated to the new setup and are so far running very smoothly.
It’s really great to know that should I need to re-install either of them, I will at least relatively quickly have a configured bash shell and be able to code and blog without to much interruption.
The whole repo is released under MIT license. Feel free to read it, experiment with it and get inspired to build something similar for your own situation. #