Changing to zsh

Why should one want to change the shell, especially if one was used to using bash for ages? For curiosity, basically.

After one week of usage (with trying a feature now and then) I migrated completly to zsh and it turned out to be worth it:

  • It is fast! And I mean it is waaaaay faster than bash
  • Tab-based completion, not much what is not completable
  • Much more powerful file globbing and regex expressions
  • Did I mention that it is so much faster than bash?
  • The command history shared across zsh instances saves quite some time

Apart from installing it there is not much needed to get started, here is what a comfortable zsh setup might look like and you might simply want to copy it to $HOME/.zshrc

# If not running interactively, don’t do anything
[ -z “$PS1″ ] && return

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd extendedglob
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename ‘/home/lastmohican/.zshrc’

autoload -Uz compinit
compinit
# End of lines added by compinstall

# Make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval “$(lesspipe)”

# Enable color support of ls and also add handy aliases
if [ “$TERM” != “dumb” ] && [ -x /usr/bin/dircolors ]; then
eval “`dircolors -b`”
alias ls=”ls -h –color=auto”
alias dir=’ls –color=auto –format=vertical’
alias vdir=’ls –color=auto –format=long’
alias grep=’grep –color=auto’
alias fgrep=’fgrep –color=auto’
alias egrep=’egrep –color=auto’
fi

alias v=”ls -lha”
alias d=”ls -ah”
alias ssi=”ssh -T -o UserKnownHostsFile=/dev/null”
alias top=”top -d 1″

export EDITOR=’/usr/bin/vi’ # Default editor
export PROMPT=’%n@%m:%~%# ‘ # Fancy prompt
export LESS=”-RIM” # Needed for git colors
#export LANG=de_DE@euros
#export LANGUAGE=de_DE
#ulimit -c unlimited # Enable ‘core’ dumps

# Set generic HTTP proxy for applications which honor http_proxy
#http_proxy=http://127.0.0.1:8118/
#HTTP_PROXY=$http_proxy
#export http_proxy HTTP_PROXY

More info on www.zsh.org. A mass of tips can be found at ZSH-Lovers.