-alias mailq="/usr/sbin/exim -bp"
-alias runq="sudo /usr/sbin/exim -qq"
-alias mailrm="sudo /usr/sbin/exim -Mrm"
-alias mailedit="sudo /usr/sbin/exim -Meb"
-alias mailfreeze="sudo /usr/sbin/exim -Mf"
-alias mailthaw="sudo /usr/sbin/exim -Mt"
-
-# ish type history list (zsh: ctrl-v key, emacs ctrl-q key)
-bindkey "\eOA" history-beginning-search-backward \
- "\e[A" history-beginning-search-backward \
- "\eOB" history-beginning-search-forward \
- "\e[B" history-beginning-search-forward \
- "\eOU" end-of-line \
- "\e[U" end-of-line \
- "^A" beginning-of-line \
- "^E" end-of-line \
- "\eOV" beginning-of-line \
- "\e[V" beginning-of-line \
- "\eOD" backward-char \
- "\e[D" backward-char \
- "\eOC" forward-char \
- "\e[C" forward-char \
- "^F" forward-word \
- "^B" backward-word \
- "\e[2~" overwrite-mode \
- "^P" push-line \
- "^K" kill-line \
- "\e[3~" delete-char
-
-# Completion options
-. $HOME/.zcomp
-
-# Add the local functions to the function search path
-fpath=($HOME/zshfuncs $fpath)
-
-# Autoload all functions on the function search path
-foreach file in $HOME/zshfuncs/*
-do
- autoload `basename $file`
-done
+
+# Select the emacs key map
+bindkey -A emacs main
+
+# Bind various keys - hard code xterm bindings to match linux xterms
+case "$TERM" in
+ dumb)
+ ;;
+ xterm*)
+ bindkey "^[OA" history-beginning-search-backward
+ bindkey "^[[A" history-beginning-search-backward
+ bindkey "^[OB" history-beginning-search-forward
+ bindkey "^[[B" history-beginning-search-forward
+ bindkey "^[OH" beginning-of-line
+ bindkey "^[OF" end-of-line
+ bindkey "^[[2~" overwrite-mode
+ bindkey "^[[3~" delete-char;;
+ *)
+ bindkey "${terminfo[kcuu1]}" history-beginning-search-backward
+ bindkey "^[[A" history-beginning-search-backward
+ bindkey "${terminfo[kcud1]}" history-beginning-search-forward
+ bindkey "^[[B" history-beginning-search-forward
+ bindkey "${terminfo[khome]}" beginning-of-line
+ bindkey "${terminfo[kend]}" end-of-line
+ bindkey "${terminfo[kich1]}" overwrite-mode
+ bindkey "${terminfo[kdch1]}" delete-char;;
+esac
+
+# Configure completion
+zstyle ":completion:*" completer _complete _approximate
+zstyle ":completion:*" format "Completing %d"
+zstyle ":completion:*" group-name ""
+zstyle ":completion:*" menu select=long
+zstyle ":completion:*" rehash true
+zstyle ":completion:*" select-prompt "%SScrolling active: current selection at %p%s"
+
+# Enable completion
+autoload -U compinit
+compinit
+
+# Autoload all local functions
+autoload ${HOME}/zshfuncs/*(:t)