How to reload Zsh config

If you're like me, you'll find yourself making small tweaks to your z shell config fairly regularly. You also probably don't want to open a new terminal window to see your new changes in effect. Thankfully I found an easy way to reload Zsh's config file without messing with new windows and all that malarkey:

  somedir  . ~/.zshrc

Yes, it's really that simple! Problem is, it's so simple I always forget it. Not only that but I like to see a confirmation that something actually happened. The fix for this "problem"? You guessed it! An alias.

  1. alias reload=". ~/.zshrc && echo 'ZSH config reloaded from ~/.zshrc'"

Now reload your config the normal way one last time so Zsh picks up your new alias, and from now on you can simply type reload into your shell after making any changes. You could even go one step further and have your changes automatically reloaded:

  1. alias reload=". ~/.zshrc && echo 'ZSH config reloaded from ~/.zshrc'"
  2. alias zshrc="vim ~/.zshrc && reload"

Reference: geekmind.net