3 min read

Enter ZSH

Superman Facing Sketch

As a programmer, I work from my terminal most of the time, sounds weird right?. Well it is because it is faster and much more productive.

If you support me then you sure know of Bourne Again shell (bash), Bourne shell (sh), Korn shell (ksh) and Z shell (zsh)

A brief History

Clock Shield Sketch

Z shell (zsh)

Zsh is a Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting. Zsh can be thought of as an extended bash with a large number of improvements, including some features of bash and ksh.

oh my zsh

oh my zsh is an open source, community-driven framework for managing your zsh configuration.

zsh - Configuration

One of the great things about zsh is that it requires almost no configuration to be useful.

Below is my ~/.zshrc file, and is personalized for my own usage, but you can fork and use it however you’d like. As you can see, it’s very simple:

# Require other configuration files.
source ~/.zsh/global_aliases
source ~/.zsh/aliases
source ~/.zsh/dir_aliases
source ~/.zsh/batt_aliases
source ~/.zsh/env_keys

# Use vim as the default text editor.
export EDITOR=vim

# Set name of the theme to load.

# Uncomment the following line to use case-sensitive completion.

# Uncomment the following line to disable bi-weekly auto-update checks.

# Uncomment the following line to change how often to auto-update (in days).

# Uncomment the following line to display red dots whilst waiting for completion.

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
plugins=(git web-search osx jsontools alias-tips)

# User configuration
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

# Load oh my zsh.
source $ZSH/oh-my-zsh.sh

# rbenv enable shims and autocomplete
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

# Node Version Manager NVM.
export NVM_DIR="/Users/akinjide/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

The changes I made are simple and for my own preferences. Here’s what my changes do:

  • Load custom configuration files. That means all aliases, environment variables and other random stuffs.
  • Set vim as my default editor. I love vim, but you can switch to emacs or others.
  • Set default theme for oh my zsh. You can set random to use different theme anytime you start your terminal.
  • Set plugins you want oh my zsh to load into your terminal.
  • rbenv is a Ruby version manager to maintain different Ruby version. Likewise, nvm, a Node version manager to maintain different NodeJS version.

As you can see, I had to make very few changes to oh my zsh in order for it to be useful to me.

zsh - Resources

If you’d like to give zsh a try, here are some resources to get you going. zsh has become my favorite and most used tools since I started using it earlier this year. I’d highly recommend it to anyone who does a lot of terminal work.