Skip to content

Instantly share code, notes, and snippets.

@alexymik
Last active April 7, 2017 12:22
Show Gist options
  • Save alexymik/7653152b655046a1d94afb07e744a0d5 to your computer and use it in GitHub Desktop.
Save alexymik/7653152b655046a1d94afb07e744a0d5 to your computer and use it in GitHub Desktop.
ZSH + Oh My ZSH Install Guide

ZSH

From https://en.wikipedia.org/wiki/Z_shell

The Z shell (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 Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Example

image

Installing ZSH on OSX

Assumes Homebrew is already installed.

  1. brew update
  2. brew install zsh
  3. Test drive with /bin/zsh or replace your default shell with chsh -s /bin/zsh

Installing Plugins

Start by installing Oh My Zsh, a plugin & theme manager for zsh.

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

Oh My Zsh will live in ~/.oh-my-zsh. There are many default plugins in ~/.oh-my-zsh/plugins/. You can enable them by adding their folder name to the plugins=(example) directive in ~/.zshrc.

The wiki will have a lot of information about the bundled plugins - https://github.com/robbyrussell/oh-my-zsh/wiki

Adding other plugins is usually done by cloning the Github repo or otherwise into ~/.oh-my-zsh/custom/plugins/. Enabling is same as above.

Modify ~/.zshrc with your specific configuration details.

Plugins and other ZSH specific config must be before the source $ZSH/oh-my-zsh.sh.

Recommended Plugins

My config

plugins=(sudo brew git bundler osx sublime vagrant rake ruby zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search)
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
setopt autocd

Installing Themes

Oh My Zsh comes bundled with a few default themes. See a brief gallery here - https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

Enable a theme by modifying ZSH_THEME="mytheme" in ~/.zshrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment