Using Zsh to build a productive developer terminal experience


One of the first things I do on any new computer is set up my terminal. This blog post is simply a reference guide for myself, listing the tools and config required for my perfect setup.

For me, this setup is productive and colorful, yet information dense, giving me the everything I need at a quick glance.

If you want to build your own interface similar to this, and have no idea where to start, I recommend Wes Bos’ course “Command Line Power User”, or his related blog post on Smashing Magazine as a jumping off point.

Optional extras

Setup steps

  1. Check you’re using Zsh terminal, which is the default on macOS, starting with Catalina (10.15)
  2. Install Oh My Zsh
  3. (Optional) Add the z (for “frecent” folder jumping), zsh-autosuggestions, zsh-syntax-highlighting plugins to your .zshrc file
  4. Install Starship and and eval "$(starship init zsh)" to the end of your .zshrc file
  5. Create a config file for Starship
  6. (Optional) Configure iTerm2 to use Snazzy theme and BlexMono nerd font

Screenshots

Terminal running ls -a in the Next.js repo, with folders, dotfiles and scripts in different colours, and a Starship prompt showing the canary git branch and Node v10.22.0

Terminal showing a git log of the Next.js repo, with commit hashes in blue, relative dates in green, authors in grey and tags in yellow

Terminal showing Jest test results for Next.js: 3 passed and 100 skipped, with the Starship prompt noting the command took 20 seconds