1 # sample by Peter Palfrader: http://svn.noreply.org/svn/weaselutils/trunk/dotfiles/zshrc
3 [ -r /etc/zsh/zprofile ] && source /etc/zsh/zprofile
4 [ -r $HOME/.profile ] && source $HOME/.profile
8 zstyle :compinstall filename "$HOME/.zshrc"
13 if [ -e $HOME/.bash_completion ]; then
16 source $HOME/.bash_completion
19 autoload colors zsh/terminfo
20 if [[ "$terminfo[colors]" -ge 8 ]]; then
25 LS_COLORS="${LS_COLORS}*.divx=01;35:"
26 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
30 zstyle ':completion:*' menu select
31 zmodload -i zsh/complist
35 # bind special keys according to readline configuration
36 #eval "$(sed -n 's/^/bindkey /; s/: / /p' /etc/inputrc)"
38 bindkey "\e[1~" beginning-of-line
39 bindkey "\e[4~" end-of-line
40 bindkey "\e[5~" history-search-backward
41 bindkey "\e[6~" history-search-forward
42 bindkey "\e[3~" delete-char
43 bindkey "\e[2~" quoted-insert
44 bindkey "\e[5C" forward-word
45 bindkey "\e[5D" backward-word
46 bindkey "\e\e[C" forward-word
47 bindkey "\e\e[D" backward-word
48 bindkey "\e[1;5C" forward-word
49 bindkey "\e[1;5D" backward-word
50 bindkey "\eOc" forward-word
51 bindkey "\eOd" backward-word
52 bindkey "\e[1;3C" forward-word
53 bindkey "\e[1;3D" backward-word
54 bindkey "\e[8~" end-of-line
55 bindkey "\eOH" beginning-of-line
56 bindkey "\eOF" end-of-line
57 bindkey "\e[H" beginning-of-line
58 bindkey "\e[F" end-of-line
59 bindkey "\e[7~" beginning-of-line
60 bindkey "\e[8~" end-of-line
75 for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
76 eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
77 eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
79 PR_BOLD="%{$terminfo[bold]%}"
80 PR_NO_COLOUR="%{$terminfo[sgr0]%}"
82 HISTFILE=~/.zsh_history
86 TIMEFMT="$terminfo[bold]$fg[yellow]%J %U user %S sys %P cpu %*E total %M kB max$terminfo[sgr0]"
88 autoload -Uz vcs_info && vcs_info
89 zstyle ':vcs_info:*' enable git cvs svn hg
90 zstyle ':vcs_info:*' use-prompt-escapes
91 zstyle ':vcs_info:*' max-exports 1
96 # default: " (%s)-[%b|%a]%u%c-"
97 zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR} "
98 # default: " (%s)-[%b]%u%c-"
99 zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR} "
102 PROMPT='%(!.$PR_RED.$PR_GREEN)%n@%m $PR_BLUE%1~ %# $PR_NO_COLOUR'
103 RPROMPT='${vcs_info_msg_0_}${PR_STUFF}'
110 local exitstatus="${?}"
112 if [[ 0 -ne "${exitstatus}" ]] ; then
113 PR_STUFF="${PR_RED}RET ${exitstatus}${PR_NO_COLOUR}"