Zsh shell tips for macOS

The ~/.zshrc doesn’t exist by default in macOS so you need to create it. The ~/ translates to your user’s home directory and the .zshrc is the ZSH configuration file itself.

nano ~/.zshrc

You can set a theme if you want as below;

ZSH_THEME="robbyrussell"

For jekyll development, if you want to add jekyll server via alias ‘jekylstart’ command,

alias jekyllstart='cd ~/dev/my-site && code . && open http://127.0.0.1:4000/my-site && bundle exec jekyll serve --drafts'

Also, run your sass files as below;

alias quicksass='cd ~/dev/my-site/assets && sass --watch style.sass:style.css

Now, to save the file in nano, just hit ctrl+X. When it prompts:

Save modified buffer (ANSWERING “No” WILL DESTROY CHANGES) ?

Just type “Y” and then you will get a new prompt which looks something like this; just note the path /Users/username/ will match your local user’s path:

File Name to Write: /Users/username/.zshrc

Now just hit return and the file will be saved and you will now be back to the command line prompt in the Terminal. If you now exit from the Terminal and then open a new window, the ~/.zshrc settings should now be loaded in.