-if [ -n "$HOME" ]; then
- HISTFILE="$HOME/.zsh_history"
- SAVEHIST=1000
+# Configuration for interactive shells.
+#
+# Copyright (C) 2009 Nick Bowler
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+if [[ -n $HOME ]]; then
+ HISTFILE=$HOME/.zsh_history
+ SAVEHIST=10000
fi
-HISTSIZE=1000
+HISTSIZE=10000
bindkey -e
-case "$TERM" in
+case $TERM in
rxvt*)
- if [ "$TERM" = "rxvt-unicode" ]; then
- [ -z "$COLORTERM" ] && export COLORTERM="rxvt-xpm"
- [ -z "$COLORFGBG" ] && export COLORFGBG="15;default;0"
+ if [[ $TERM == rxvt-unicode ]]; then
+ [[ -z $COLORTERM ]] && export COLORTERM='rxvt-xpm'
+ [[ -z $COLORFGBG ]] && export COLORFGBG='15;default;0'
fi
bindkey '\e[3~' delete-char
;;
xterm)
bindkey '\e[3~' delete-char
- bindkey '\e[F' end-of-line
- bindkey '\e[H' beginning-of-line
- bindkey '\eOH' beginning-of-line
- bindkey '\eOF' end-of-line
+ bindkey '\e[F' end-of-line
+ bindkey '\e[H' beginning-of-line
+ bindkey '\eOH' beginning-of-line
+ bindkey '\eOF' end-of-line
+;;
+cons25)
+ bindkey '^?' delete-char
+ bindkey '\e[F' end-of-line
+ bindkey '\e[H' beginning-of-line
;;
esac
# Set the xterm title
-case "$TERM" in
+case $TERM in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
settitle() { print -Pn $'\e]0;%n@%m %33<...<%~%<<\a' }
;;
;;
esac
+# Show the return code of failed commands, but don't be noisy about it.
precmd() {
settitle
- if [[ -n "$__NEWRUN" ]]; then
- RPS1=$'%(0?,,%{\e[31;1m%}RC=%?%{\e[0m%})'
+ if [[ -n $__NEWRUN ]]; then
+ RPS1='%(0?,,%B%F{red}RC=%?%f%b)'
unset __NEWRUN
else
unset RPS1
__NEWRUN=yes
}
-if [ -n "$COLORTERM" ]; then
- PS1=$'%(!,%{\e[31;1m%},%{\e[32;1m%}%n@)%m%{\e[34;1m%} %33<...<%~%<< %#%{\e[0m%} '
+# A gentoo-like prompt.
+PS1='%B%(!,%F{red},%F{green}%n@)%m %F{blue}%33<...<%~%<< %#%f%b '
- # Random colour-related options
+if [ -n $COLORTERM ]; then
+ # Assorted colour-related options
export MINICOM="-c on"
-else
- PS1='%n@%m %33<...<%~%<< %# '
fi
-if [[ -n "$SSH_CONNECTION" ]]; then
- PS1="${PS1/\[32/[33}"
+if [[ -n $SSH_CONNECTION ]]; then
+ PS1=${PS1/green/yellow}
fi
+# Locale
+export LANG=en_CA.UTF-8
+export LC_COLLATE=ja_JP.UTF-8
+
# I like colours
alias ls='ls --color=auto'
alias grep='grep --color=auto'