Dotfiles
As part of my efforts to get more serious back into development and to lean into my technical career growth, I have been working on getting my Mac Studio out of peusdo storage and making it more of my main computer again. I have been cleaning up my drives and applications, setting up hotkeys and automations, and setting up a more or less fresh development environment, all while trying to lean into a more hobbyist and enthusiastic mindset.
This led me to wanting to file get a proper solution in place for my dotfiles.
Now really I only care about my configurations for zsh since that is the only thing I have to worry about across machines right now, but I was really itching to git all of my aliases that I have set up on my work machine moved over to my terminal on the Studio.
I knew I wanted to have version control via git and wanted it be reasonably flexible for various kinds of configurations not just zsh, and I figured I didn't want to just track my entire ~./ directory in a repo. I knew this had to be a solved problem, so embracing my thought of "LLMs should make hobbyist development easier" I went to ChatGPT's recent 5.1 release.
After some quick prompting I confirmed some back of head thoughts around the idea of having a repo somewhere else and making symlinks to files within it, as well as coming up with a package that would do all the heavy lifting for me while also offering up some unexpected additional functionality.
GNU's stow command was the solution I went with. Not native to MacOS, I grabbed the tool with brew and was up in running in no time. The stow command works by creating symlinks to my home directory from a dotfiles repo that I made on disk.
Here is what the repo looks like:
~/dotfiles/
│
├── zsh/
│ ├── .zshrc
│ └── .zprofilea
After running stow zsh in ~./dotfiles, my home directory looks like this:
~/
│
├── .zshrc → ~/dotfiles/zsh/.zshrc
└── .zprofile → ~/dotfiles/zsh/.zprofile
The extra functionality I alluded to earlier is that stow has the --dotfiles flag. This will replace any occurrences of dot- at the start of a file with a .. This lets me keep the files in the repo as visible files. So in the end the repo and mapping looks like this:
~/dotfiles/
│
└── zsh/
├── dot-zshrc
└── dot-zprofile
~/
│
├── .zshrc → ~/dotfiles/zsh/dot-zshrc
└── .zprofile → ~/dotfiles/zsh/dot-zprofile
I went ahead and made the repo as well and am calling this a success for a Sunday project. I'm happy to have solved a problem that has been in the back of my mind for ages. This is exactly the kind of stuff I want to spend more time doing.
I have to reflect to on how useful I found an LLM for all of this. From being able to ask specific questions and take out the middle steps of searching on Google and parsing Reddit and Stack Overflow pages, I could get a general idea right from the start.
Then it was super easy to use Google to look up the specific commands and techniques I was going to use and find forums and documentation to explain how to do this in a deterministic / evidence based way. I think this is a great workflow for LLMs. Use them for the initial brainstorming and to gather information that is quick and easy to verify.
It was also useful for making a cheatsheet for vim while I was writing up the repo's README, and for formatting those markdown file structure figures above. There are so many little uses that make it more fun for me to create. The spirit I want to get behind is focusing on how they lower the barrier to entry for me and how I can do more.
Special thanks to the participants of this hacker news thread which led to this blog post from Brandon Invergo. I followed this more or less to the letter and had no issues.