powerline for zsh

I discovered some time ago vim-powerline a cool semi-graphical status line for vim

Jérémy Romey adapted it for zsh.

You can see here for example if you have any pending files to commit on git in the current git repo of your working directory and the current branch you are on.

Note : this is my slightly adapted version with the international format for the time.

Here is a quick tutorial to install this version.

Safety first ... backup your .zshrc, you never know if you gonna brake something

cp .zshrc .zshrc.bak

Install and make sure you use a powerline patched font in your terminal.
For example I like Envy R Monaco

Now, simply grab my for of "oh-my-zsh" and copy the config template.

git clone git://github.com/gbin/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Change the theme to "powerline", add your aliases in your ~/.zshrc, and some plugins. Here is mine.

# Path to your oh-my-zsh configuration.

# Set name of the theme to load.

alias ls='ls --color=auto'
alias ll='ls -l --color=auto'
alias la='ls -A --color=auto'
alias l='ls -CF --color=auto'
alias diff='colordiff'

alias -s gz='tar -xzvf'
alias -s bz2='tar -xjvf'
alias -s zip='unzip'
alias -s txt=$EDITOR
alias -s html=$BROWSER

# 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)
plugins=(git github pip python)

source $ZSH/oh-my-zsh.sh

Open a new terminal and boom, it should work. Awesome no ?

1 comment:

  1. This might be too late... But THANKS! This works just out of the box.

    I tried the powerline-zsh github projects which had a lot of errors.