1 # Configuration for interactive shells.
3 # Copyright (C) 2009 Nick Bowler
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved. This file is offered as-is,
8 # without any warranty.
10 # Default shell options
13 if [[ -n $HOME ]]; then
14 HISTFILE=$HOME/.zsh_history
23 if [[ $TERM =~ '^rxvt-unicode' ]]; then
24 [[ -z $COLORTERM ]] && export COLORTERM='rxvt-xpm'
25 [[ -z $COLORFGBG ]] && export COLORFGBG='15;default;0'
28 bindkey '\e[3~' delete-char
29 bindkey '\e[8~' end-of-line
30 bindkey '\e[7~' beginning-of-line
33 bindkey '\e[3~' delete-char
34 bindkey '\e[4~' end-of-line
35 bindkey '\e[1~' beginning-of-line
36 bindkey '\eOM' accept-line
39 bindkey '\e[3~' delete-char
40 bindkey '\e[F' end-of-line
41 bindkey '\e[H' beginning-of-line
42 bindkey '\eOH' beginning-of-line
43 bindkey '\eOF' end-of-line
46 bindkey '^?' delete-char
47 bindkey '\e[F' end-of-line
48 bindkey '\e[H' beginning-of-line
52 # Keymap-specific bindings
55 bindkey '^R' history-incremental-search-forward
56 bindkey '^P' history-incremental-search-backward
62 xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
63 settitle() { print -Pn $'\e]0;%n@%m %33<...<%~%<<\a' }
66 settitle() { print -Pn $'\e_%n@%m %33<...<%~%<<\e\\' }
73 # Show the return code of failed commands, but don't be noisy about it.
77 if [[ -n $__NEWRUN ]]; then
78 RPS1='%(0?,,%B%F{red}RC=%?%f%b)'
89 # A gentoo-like prompt.
90 PS1='%B%(!,%F{red},%F{green}%n@)%m %F{blue}%33<...<%~%<< %#%f%b '
92 if [ -n $COLORTERM ]; then
93 # Assorted colour-related options
94 export MINICOM="-c on"
97 if [[ -n $SSH_CONNECTION ]]; then
98 PS1=${PS1/green/yellow}
102 export LANG=en_CA.UTF-8
103 export LC_COLLATE=ja_JP.UTF-8
105 # Default options for various utilities.
106 alias ls='ls --time-style=long-iso --color=auto'
107 alias grep='grep --color=auto'
115 alias vv='$EDITOR ~/.zshrc && source ~/.zshrc'