Skip to content

Instantly share code, notes, and snippets.

@cecepm
Last active April 1, 2019 04:12
Show Gist options
  • Save cecepm/5628827 to your computer and use it in GitHub Desktop.
Save cecepm/5628827 to your computer and use it in GitHub Desktop.
Setup ZSH with help from oh-my-zsh

Setup ZSH with help from oh-my-zsh

iTerm in action

Installing oh-my-zsh

Clone repository

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

Optional backup .zshrc config

cp ~/.zshrc ~/.zshrc.orig

Create a new zsh config by copying the zsh template oh-my-zsh provided

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Set zsh as your default shell

chsh -s /bin/zsh

Installing Powerline Themes

Clone repository

git clone https://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme.git ~/.oh-my-zsh-powerline-theme

Create symlink to oh-my-zsh themes folder

ln -f powerline.zsh-theme ~/.oh-my-zsh/themes/powerline.zsh-theme

Configure the theme in your .zshrc file

ZSH_THEME="powerline"

Install powerline fonts (pre-patched and adjusted fonts for usage with the new Powerline plugin). Download fonts from this repository:

https://github.com/Lokaltog/powerline-fonts

MAC: copy fonts to folder ~/Library/Fonts/

Linux: copy fonts to folder ~/.fonts/

Installing Custom Plugins for oh-my-zsh

Create custom plugins directory

mkdir ~/.oh-my-zsh/custom/plugins

zsh-syntax-highlighting

cd ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git

Others

Screenshot shown above:

iTerm
custom color schemes (based on Zenburn color schemes)
Menlo Regular for Powerline - 11pt

Example .zshrc

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
 
# Configuration for powerline theme
# Look in ~/.oh-my-zsh-powerline-theme
POWERLINE_DETECT_SSH="true"
POWERLINE_RIGHT_A="date"
POWERLINE_HIDE_HOST_NAME="true"

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
ZSH_THEME="powerline"

# 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)
plugins=(colored-man git history-substring-search sublime vagrant zsh-syntax-highlighting)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

# Set 256 Color
export TERM=xterm-256color

# VirtualEnv
if [ -z "$VIRTUALENVWRAPPER_PYTHON" ]
then
    source /usr/local/bin/virtualenvwrapper.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment