I personally love this combination of iTerm2 + ZSH + Oh-my-zsh.

iTerm2 is an amazing terminal, I always prefer it over macOS default terminal. If you want to install it then just go to iTerm2 site , download it and install. It has many advantages over macOS default terminal. Some of those are, easy finder you can easily search for the text in terminal, nice autocomplete feature, split panes, paste history and many more. I would highly recommend it and you can explore all of its highlighting feature

Oh-my-zsh(OMZ) really makes terminal (iterm2) more interesting and useful. You do not need to punch in same long command again and again. Rather you get the easy completion or shortcut commands by using various plugins of Oh-my-zsh (OMZ).

How to use iTerm2 + ZSH + Oh-my-zsh on you Mac


First of all install homebrew on your Mac to do that just paste this command on your terminal. Once brew is installed after that installing other packages is very easy.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now we can install ZSH shell but before installing just check if it exists and what is the version you have

zsh --version
brew install zsh zsh-completions

Once ZSH is installed, you can install oh-my-zsh (OMZ) using curl or wget command

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Or

sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Post installation, you can customise ~/.zshrc file. This is the default file which gets generated. OMZ sets some basic configurations like theme, plugins etc.

This is the sample of ~/.zshrc file, just for reference.

.Zshrc Useful Configurations


Themes

In .Zshrc we can configure ZSH_THEME by three different ways.

Choose any of the theme of interest and then just assign it to ZSH_THEME

  # Set name of the theme to load. Optionally, if you set this to "random"
  # it'll load a random theme each time that oh-my-zsh is loaded.
  # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
  ZSH_THEME="mortalscumbag"

Set ZSH_THEME as random. In that case computer will choose random theme and it will change theme every time we load terminal. It will pick the theme from the default OMZ theme list

ZSH_THEME="random"

Another option to have random themes of your choice from a limited set. For that you can set ZSH_THEME and ZSH_THEME_RANDOM_CANDIDATES values and now terminal will pick the theme randomly from defined list.

ZSH_THEME="random" 
ZSH_THEME_RANDOM_CANDIDATES=(
"gallois"
"kolo"
"mortalscumbag"
)

Other than these default themes there are also many external custom themes too. You can also use those as per your interest.

Plugins

OMZ plugins are help for auto completion of the commands and aliases. These plugins really helps improving productivity. To add the plugins of your choice, you have to update .zshrc -> plugins value as shown below.

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(jira git git-extras git-flow colored-man colorize github bundler pip python brew osx rails rvm redis-cli zsh-syntax-highlighting npm docker bower node sublime sudo supervisor web-search sublime yarn)

As we use Jira storyboard, Ruby on Rails, JS frameworks (ember.js, react.js etc) for development, Redis etc. So these are some of the plugins which I really find useful.

GIT, as git commit, git checkout etc commands are used so frequently while you are doing development. By using GIT plugin you need not to type more character. Instead we just need to use shorthand, which saves a lot of time. All these git command shortcuts are well listed here

e.g.
**gc** for `git commit`
**g** for `git` 
**ga** for `git add` etc. 

Jira - if you use Jira and want to create JIRA issue from command line then you can use this plugin and before using this you have to set your jira_url so that it points to your jira url. There is one more modified JIRA plugin you can refer that here

For JavaScript packages you can use node, npm , bower, yarn etc plugins. These plugins provides some aliases and completions

e.g
Bower install   ---> . bi
Bower list        ---> . bl

In case of npm, node, yarn etc. it gives you option of auto completion. e.g. You just type npm i and tab it will show you possible commands starting with i which makes life easier.

There are many useful plugins which you can use as per your need.

Enjoy Exploring ......

698f0d7fb51171fb6563bc888a466d1b
About Shivani Thakur

I am life time learner, passionate about technology, fullstack programmer and prefer clean deliveries. I am fearless, honest and vocal about my thoughts. That helps me personally and professionally to convey my thoughts clearly. I do not like unfinished stuff for long time as that makes me uncomfortable. I Love to try out new technologies :) and completely enjoy UI designing. I like reading books, most of the times I prefer to read motivational and spiritual books. To enjoy nature and God's creation I do landscape/nature Photography. I paint to be with myself and love to travel places. I like mediation as that way I can spend time with myself and listen to myself. I am a loner so I love spending time with myself. I am not extrovert but I love good company. I love cooking new different recipes in my free time. Movies and Music (Meaningful songs :)) are refreshing for me. I love writing too and would love to write book some day!!

Your comment

*

*