A Beautifully Productive Terminal Experience iTerm, Oh-My-Zsh

  • (1 Vote)
  • Written by 
  • Friday, 13 October 2017 21:00

Every developer can benefit from using the command line. Whether you use it to bounce between projects or create complex scripts, getting familiar with the command line can drastically improve your workflow.

In this post, we’ll cover some of the great tools available for streamlining your command line experience.

How to install powerlevel10k/powerlevel10k shell: https://gist.github.com/kevin-smets/8568070

After some experimenting, I’ve found that using a combination of iTerm 2, Oh-My-ZshZsh, Prezto, Z, Trash & Origami for Sublime Text - makes for an extremely productive setup.


iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.8 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.



Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.

Sounds boring. Let's try again.

Oh My Zsh will not make you a 10x developer...but you might feel like one.

Once installed, your terminal shell will become the talk of the town or your money back! With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, "that is amazing! are you some sort of genius?"

Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often.


Install OH-MY-ZSH

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

First - you need fix system Fonts: https://github.com/powerline/fonts

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
# clean-up a bit
cd ..
rm -rf fonts

Install Homebrew

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

Install wget

brew install wget

Install Powerlevel9k theme to ZSH

If you prefer the Powerlevel9k look with added info such as exit codes and timestamps on the right, run:

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

Then edit your ~/.zshrc and set ZSH_THEME="powerlevel9k/powerlevel9k"


Works on macOS, Linux, and Windows.

In contrast to fs.unlink, del, and rimraf which permanently delete files, this only moves them to the trash, which is much safer and reversible.

sudo npm install --global trash



OSx Plugin

osx commands a3650


Tracks your most used directories, based on 'frecency'. After a short learning phase, z will take you to the most 'frecent' directory that matches ALL of the regexes given on the command line, in order. For example, z foo bar would match /foo/bar but not /bar/foo.

U need copy z.sh raw file from github to ~


Download it to root directory ~

Plugins what u can use in ~/.zshrc

plugins=(battery git node npm cloudapp composer docker fastd zsh-peco-history osx sublime sudo)

I attache my .zshrc file or watch all code:

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster" #my theme

# 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 disable colors in ls.

# Uncomment the following line to disable auto-setting terminal title.

# Uncomment the following line to enable command auto-correction.

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

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# 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=(battery git node npm cloudapp composer docker fastd zsh-peco-history osx sublime sudo chucknorris)

source $ZSH/oh-my-zsh.sh

# User configuration

export PATH=$HOME/bin:/usr/local/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"

eval "$(rbenv init -)"

# include Z, yo
. ~/z.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias db="cd ~/Dropbox/"
alias doc="cd ~/Documents/"
alias zs="subl ~/.zshrc"
alias gum="git pull upstream master"

alias -g xcopy='xclip -selection clipboard'
alias -g xpaste='xclip -selection clipboard -o'

# set java home
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=/usr/local/bin:/usr/local/sbin:$PATH

# set up andoird home
# android installed into ~/Public/installations
export ANDROID_HOME=/Users/eranga/Public/installations/android-sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools

# set up andoird NDK
#export NDK_HOME=/Users/eranga/Public/installations/android-ndk
export NDK_ROOT=/Users/eranga/Public/installations/android-ndk-r13b
export NDK_HOME=/Users/eranga/Public/installations/android-ndk-r13b

# setup gradle home
export GRADLE_HOME=/Users/eranga/Public/installations/gradle

# set up RabbitMQ server scripts
export PATH=$PATH:/usr/local/sbin

# fix django locale issue from here on mac
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# swift run on command line
# alias swift="/Applications/Xcode6-Beta2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift"

# enable/venv
# alias venv="source /Users/eranga/Public/installations/venv/bin/activate"

# django auto complete
# . $HOME/.django_bash_completion

# set up maven home 
#export M2_HOME=/usr/local/Cellar/maven/3.2.3/libexec

# Colorize maven
alias maven="/usr/local/bin/mvn"
alias mvn="colorize_maven"

colorize_maven() {
  local BOLD=`tput bold`
  local TEXT_RED=`tput setaf 1`
  local TEXT_GREEN=`tput setaf 2`
  local TEXT_YELLOW=`tput setaf 3`
  local RESET_FORMATTING=`tput sgr0`

  maven $@ | sed -e "s/\(\[INFO\]\ \-\-\-\ .*\)/${TEXT_BLUE}\1${RESET_FORMATTING}/g" \
    -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}\1${RESET_FORMATTING}/g" \
    -e "s/\(\[INFO\]\ \)\(BUILD SUCCESS\)/\1${TEXT_GREEN}\2${RESET_FORMATTING}/g" \
    -e "s/\(\[INFO\]\ \)\(BUILD FAILURE\)/\1${TEXT_RED}\2${RESET_FORMATTING}/g" \
    -e "s/\(\[WARNING\].*\)/${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
    -e "s/\(\[ERROR\]\)/${TEXT_RED}\1${RESET_FORMATTING}/g" \
    -e "s/\(Failed tests: \)/${TEXT_RED}\1${RESET_FORMATTING}/g" \
    -e "s/\(Exception in thread \".*\" \)\(.*\)/\1${TEXT_RED}\2${RESET_FORMATTING}/g" \
    -e "s/\(Caused by: \)\([^:\t ]*\)/\1${TEXT_RED}\2${RESET_FORMATTING}/g" \
    -e "s/\(ERROR\ \[.*\)/${TEXT_RED}\1${RESET_FORMATTING}/g" \
    -e "s/Tests run: \([^,]*\), Failures: \([^,0]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${TEXT_YELLOW}\4${RESET_FORMATTING}/g"

  echo -ne ${RESET_FORMATTING}

# set up boot2docker
export DOCKER_HOST=tcp://
#export DOCKER_CERT_PATH=/Users/eranga/.boot2docker/certs/boot2docker-vm

# Set java opts to find whats going wrong with jrebel
export JAVA_OPTS="$JAVA_OPTS -Drebel.log=true"

# github token for homebrew
export HOMEBREW_GITHUB_API_TOKEN=0633wefdd93ff53f84a85957def2d7ef1c85c698

# cheat 
export CHEATCOLORS=true
export EDITOR=vim 

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

Color Presets

##Installation Instructions## To install:

  • Launch iTerm 2. Get the latest version at iterm2.com
  • Type CMD+i (⌘+i)
  • Navigate to Colors tab
  • Click on Load Presets
  • Click on Import
  • Select the .itermcolors file(s) of the scheme(s) you'd like to use
  • Click on Load Presets and choose a color scheme

Link to iTerm Color Schemes or download my attasched file iTerm2-Color-Schemes-master.zip

Terminal Are Sexy!

6474 Read Last modified on Sunday, 14 June 2020

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.