You are here

Update shell to ZSH on OSX & UNIX

zsh shell with solarized dark & dogenpunk theme

((( This is for *NIX users - so OS X or Linux. If you're on Windows, check out: )))

Today we will be upgrading (re: changing) our shell from bash to zsh!

More on zsh here:

Why do you need it? Well, you don't technically... but I HIGHLY recommend it.

We will be using a package called 'oh my zsh!' from

1. If you don't have it already, install ZSH. This comes with OSX but you might need to download it on other forms of UNIX.

$ apt-get install zsh

2. Install Oh My ZSH! - there are two ways to do this...

-- via `curl`

$ curl -L | sh

-- via `wget`

$ wget --no-check-certificate -O - | sh

--Note: only one of these lines is necessary - it depends on your system. On OSX I used the curl method.

3. The package installer will run and you may be prompted to answer 'yes' to a few questions.

4. Once oh my zsh is installed, you should close your current CLI (CMD+Q on Mac)

5. Re-open your CLI of choice and now you are using ZSH!

6. You can configure zsh through your .zshrc file

$  vim ~/.zshrc</pre>

It should look something like this:

# Path to your oh-my-zsh configuration.
# 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.
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Set to this to use case-sensitive completion

# Comment this out to disable weekly auto-update checks

# Uncomment following line if you want to disable colors in ls

# Uncomment following line if you want to disable autosetting terminal title.

# Uncomment following line if you want red dots to be displayed while waiting for completion

# 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)
source $ZSH/
# Customize to your needs...
export PATH=/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

I am not a big fan of the auto-correct that comes with oh-my-zsh so I turned that off adding this to my .zshrc:

unsetopt correct_all

There are a number of oh-my-zsh themes here:

Just change the string ZSH_THEME="robbyrussell" to ZSH_THEME="newthemename"

You must exit your CLI and re-open it to see the new theme.


Submitted by diana on Thu, 05/10/2012 - 11:39