March 05, 2021
Art by my buddy Loor Nicolas
You get a new computer, you back up all your files but…
OH! you forgot to back up your
~/.zshrc where all your custom aliases and functions live! Now you need to start over with them…
To save you this headache, I’m sharing my super-useful custom alias for updating my shell config that does the following:
Let’s set it up.
Creating a secret Gist.
https://gist.github.com/jportella93/616c872593daf91781d6842c9829b1f0so I’m copying
~/.zshrcinclude this line:
alias zshrc="gedit ~/.zshrc && \ gist-paste -u 616c872593daf91781d6842c9829b1f0 ~/.zshrc && \ exec zsh"
I’m using gedit as text editor but you can use any other like
code. Then replace the gist identifier
616c872593daf91781d6842c9829b1f0with the one you copied in the previous step.
zshrcin your CLI, make changes on your text editor, and changes will be backed up on the Gist automatically. Moreover, you’ll be able to use your updated alias right away! How cool is that?
Written by Jon Portella.