Syncing my dotfiles between my home and office pcs using gist
I recently have started learning the VIM with tmux and been using it both at my home and office. As I experiment with different vim configuration and plugins, I frequently find myself editing the vim and tmux configuration. I use Gist to keep the backups of the dotfiles. Sometimes I upload my config to the gist at office and then coming back at home, I pull it and sync the home pc. Sometime I do the opposite. This back and forth updating of the gist gets very annoying sometimes. So like all lazy programmers out there, I quickly wrote this bash function and put it my
.zshrc. Now everytime I update a config, I just run following command:
and the back at my other pc, I just do :
to sync up the file.
I know there are many other dotfile syncing tools out there, but I needed something simple and manageable right from my zsh config. It Just does what I need, not another feature-rich tool, 99% of which remains unused. Maybe I’ll put these two commands in aliases and save some keystrokes, but for now, I’ll stick with
Here is the bash function I used. It uses
jq to parse the json response from api.github.com/gist. I know it’s another dependent tool, but that’s fine for me as I always have jq installed in my pcs.