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"
11 autoload -U compinit promptinit
13 zstyle ':completion::complete:*' use-cache 1
15 autoload colors zsh/terminfo
16 if [[ "$terminfo[colors]" -ge 8 ]]; then
21 LS_COLORS="${LS_COLORS}*.divx=01;35:"
22 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
24 zstyle ':completion:*' menu select
25 zmodload -i zsh/complist
27 # bind special keys according to readline configuration
28 #eval "$(sed -n 's/^/bindkey /; s/: / /p' /etc/inputrc)"
30 bindkey "\e[1~" beginning-of-line
31 bindkey "\e[4~" end-of-line
32 bindkey "\e[5~" history-search-backward
33 bindkey "\e[6~" history-search-forward
34 bindkey "\e[3~" delete-char
35 bindkey "\e[2~" quoted-insert
36 bindkey "\e[5C" forward-word
37 bindkey "\e[5D" backward-word
38 bindkey "\e\e[C" forward-word
39 bindkey "\e\e[D" backward-word
40 bindkey "\e[1;5C" forward-word
41 bindkey "\e[1;5D" backward-word
42 bindkey "\eOc" forward-word
43 bindkey "\eOd" backward-word
44 bindkey "\e[1;3C" forward-word
45 bindkey "\e[1;3D" backward-word
46 bindkey "\e[8~" end-of-line
47 bindkey "\eOH" beginning-of-line
48 bindkey "\eOF" end-of-line
49 bindkey "\e[H" beginning-of-line
50 bindkey "\e[F" end-of-line
51 bindkey "\e[7~" beginning-of-line
52 bindkey "\e[8~" end-of-line
67 HISTFILE=~/.zsh_history
71 TIMEFMT="$fg[magenta]%J %U user %S sys %P cpu %*E total %M MB RSS max$terminfo[sgr0]"
74 # Load starship if exists, and that's it.
75 #if [ $TERM != "linux" ] && type "starship" > /dev/null; then
76 eval "$(starship init zsh)"
81 # Otherwise, do some homebrewn configuration
83 autoload -Uz vcs_info && vcs_info
84 zstyle ':vcs_info:*' enable git cvs svn hg
85 zstyle ':vcs_info:*' use-prompt-escapes
86 zstyle ':vcs_info:*' max-exports 1
91 # default: " (%s)-[%b|%a]%u%c-"
92 zstyle ':vcs_info:*' actionformats " %s: %b|%a"
93 # default: " (%s)-[%b]%u%c-"
94 zstyle ':vcs_info:*' formats " %s: %b"
98 %(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})%n@%m%{$reset_color%}$PR_SCREEN$PR_JOBS%{$fg_bold[yellow]%}${vcs_info_msg_0_}%{$reset_color%} %{$fg_bold[blue]%}%~%{$reset_color%}
103 # Obtain the autofs mountpoints
105 [ -r /etc/auto.master ] && autofs_mp=($(/bin/grep -e "^/" /etc/auto.master | cut -f1))
109 PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
111 # Check whether current directory is a subdirectory of an autofs mountpoint
114 for mp in ${autofs_mp}; do
115 # A parent directory is an autofs mount point
116 if echo "$PWD" | /bin/grep -q $mp; then
119 if echo "$mp" | /bin/grep -q $PWD; then
120 vcs_info_msg_0_=" [autofs]"
126 if [ -z "$vcs_info_msg_0_" ]; then
127 if [ "$parent" = "1" ]; then
128 # svn and hg cause complaints of autofs that .svn and .hg is no mount point
129 zstyle ':vcs_info:*' enable git cvs
131 zstyle ':vcs_info:*' enable git cvs svn hg
137 if [[ -n "${WINDOW}" ]]; then
138 PR_SCREEN=" S:${WINDOW}"
142 if [[ $(jobs | wc -l) -gt 0 ]]; then