As you say, zsh is similar in many respects to bash. It has some features you won't find in bash, and it can be extended in powerful ways. Don't think of moving as a kind of revolution, but rather as a series of evolutionary steps that help you in you daily work. Here are some hints from my .zshrc. Although you say you prefer single pieces of advice, this post is a longish list. Still it is a good idea to go through the points one by one. Just add the interesting bits to you ~/.zshrc and reload with source ~/.zshrc. A final tip: learn the keystrokes of zsh's default ("Emacs") keyboard shortcuts: ^A ^E ^W Alt-F Alt-B Alt-P ^L ^R. You can replace Alt by two separate keystrokes: Alt-P is equivalent to ESC P.
autoload -U compinit
compinit
This gives you more extensive tab completion.
setopt completeinword
Tab completion from both ends.
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
Tab completion should be case-insensitive.
zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd'
Better completion for killall.
autoload select-word-style
select-word-style shell
Changes the definition of "word", e.g. with ^W.
if [[ -x "`whence -p dircolors`" ]]; then
eval `dircolors`
alias ls='ls -F --color=auto'
else
alias ls='ls -F'
fi
Colors for ls.
alias ll='ls -l'
alias la='ls -a'
Shortcuts for ls.
HISTFILE=~/.zhistory
HISTSIZE=SAVEHIST=10000
setopt incappendhistory
setopt sharehistory
setopt extendedhistory
One history for all open shells; store 10,000 entires. This makes this into a useful memory aid to find the commands you used last time for ./configure etc. Use Alt-P (find command that starts like this) and ^R (search in history) liberally.
# superglobs
setopt extendedglob
unsetopt caseglob
Enables all sorts of extended globbing, such as ls */.txt (find all text files), ls -d *(D) (show all files including those starting with "."). To find out more, go to man zshexpn, section "FILENAME GENERATION".
setopt interactivecomments # pound sign in interactive prompt
This is useful to remember command in your history without executing them.
setopt auto_cd
Type ".." instead of "cd ..", "/usr/include" instead of "cd /usr/include".
PS1='[%T] %n@%m:%~# '
Nice prompt.
REPORTTIME=10
Display CPU usage stats for commands taking more than 10 seconds
alias 'a=sudo aptitude'
alias 'ai=sudo aptitude install'
alias 'ar=sudo aptitude remove'
alias 'au=sudo aptitude update'
alias 'ag=sudo aptitude safe-upgrade'
alias 'as=apt-cache search'
alias 'aw=apt-cache show'
Some commands you use extensively in Ubuntu.
function apt-list-packages {
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
}
Lists packages sorted by their size - useful when deciding which packages are taking up you disk space.