I recently went all-in on Vim, abandoning my years-long loyalty to VSCode. More on that later, but one thing that configuring my vim setup made clear was that my dotfile situation was a mess. Between my work machine and my personal machine, I had some things configured one way at work and another at home. I did have a git repo for some of my dotfiles, but I didn’t keep them updated and it just added to the confusion. Between alacritty, git, tmux, vim, zsh, global git… it’s no wonder things can get out of hand!

So I finally consolidated everything into a single dotfiles git repo. But I knew that if I were to have a real shot of actually keeping everything in sync, I’d have to automate it. So I created a bash script which, when run, will set up all my symlinks and make sure that all of my config files are in sync with what is in my git repo.

If you have an existing file, dir, or symlink where you want to put your config files, the script will ask you if you’re ok to delete it and replace it with what’s in your repo. Otherwise, it will just go ahead and create it.

Just like that! Everything’s set up. You no longer have to remember which argument comes first — the source_file, or the target_file — for your ln symlink command 😄