7 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z} r:|[/]=* r:|=*'
8 zstyle ':completion:*' use-cache true
10 if [ -d "$HOME/.zfunc" ]; then
11 fpath=($HOME/.zfunc $fpath)
12 autoload -U ~/.zfunc/*(:t)
16 unfunction $f:t 2> /dev/null
21 if [ -f "$HOME/.ssh/known_hosts" ]; then
22 _cache_hosts=(`perl -ne 'if (/^([a-zA-Z0-9.-]+)/) { print "$1\n";}' ~/.ssh/known_hosts`)
33 setopt auto_param_keys
34 setopt auto_param_slash
35 setopt auto_remove_slash
38 setopt complete_aliases
45 setopt pushd_ignore_dups
47 setopt sh_file_expansion
48 setopt always_last_prompt
50 setopt hist_ignore_all_dups
51 setopt hist_ignore_space
52 setopt inc_append_history
55 function _we_are_in_gnu_screen () {
59 _prompt_base='%B[%n@%m] %{%(?.$fg[green].$fg[red])%}%#%{$reset_color%}%b '
60 if ( _we_are_in_gnu_screen ); then
61 # GNU Screen has a capability to set its window title by "ESC k
62 # {string} ESC \". We want to reset the title to `_' to show we
63 # aren't running any command now.
64 PROMPT=$'%{\ek_\e\\%}'$_prompt_base
69 function preexec() { # Hook
70 if { _we_are_in_gnu_screen } then
71 # Set the window title of GNU Screen.
72 local cmd=${1[(wr)^(*=*|sudo|nice|env|time|ssh|-*|[0-9]*)]}
77 function precmd() { # Hook
78 local dirinfo=$(print_directory_info $(pwd))
84 RPROMPT="%U%~%u %U($dirinfo)%u";;
88 function print_directory_info() {
91 if [[ -d $absdir/.git ]] then
93 git branch --no-color 2>/dev/null \
94 | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
96 elif [[ -r $absdir/.hg/branch ]] then
98 local hgbranch=`cat $absdir/.hg/branch`
99 if [[ -e $absdir/.hg/unpushed ]] then
105 elif [[ -d $absdir/_darcs ]] then
109 elif [[ -r $absdir/CVS/Repository ]] then
111 cat $absdir/CVS/Repository \
112 | sed -e 's!\([^/]*\).*!\1!'
116 if [[ $absdir = "/" ]] then
117 # This is the root directory so exit from the recursion.
120 # Recurse to the parent dir.
121 print_directory_info $(dirname $absdir)
126 HISTFILE="$HOME/.zhistory"
130 alias -g L="| $PAGER"
141 alias ed='ed -p "ed> "'
144 alias mwget="wget --user-agent='Mozilla/1.4b'"
145 alias pstow="pushd /usr/local/stow"
146 alias w3m="w3m -O UTF-8"
147 alias w3mb="w3m -O UTF-8 -B"
148 alias pkgsrc="pushd /usr/pkgsrc"
149 alias man="LANG=C man"
151 alias aria="ssh -X admin@aria.cielonegro.org"
152 alias nem="ssh -X pho@nem.cielonegro.org"
153 alias mikasa="ssh -X daimon@mikasa.tomilab.net"
155 alias aria-emacs="ssh -f -X admin@aria.cielonegro.org emacsclient -c"
157 alias g1="ssh pho@g1.cuenote.jp"
158 alias g2="ssh pho@g2.cuenote.jp"
159 alias mana="ssh pho@mana"
161 if [ $(hostname) = "aria.cielonegro.org" ]; then
162 alias firefox="/opt/local/bin/firefox"
163 alias safari="open -a Safari"
164 alias unstuff='open -a StuffIt\ Expander.app'
165 alias pa='open -a NiseRingo.app'
166 alias heboris='open /Applications/HeborisUEMac/exe/Heboris\ OpenGL.app'
167 alias hengband='open ~/Applications/hengband*/Hengband*'
170 if [ $(uname) = "Darwin" ]; then
178 alias top='/usr/bin/top -X -o cpu'
186 # The following lines were added by compinstall
188 zstyle :compinstall filename "$HOME/.zshrc"
192 # End of lines added by compinstall
194 if [ "x$WINDOW" = "x" ]; then
195 if which fortune 2>&1 >/dev/null; then
200 if [ -e ".motd" ]; then
204 if which ssh-agent-manager 2>&1 >/dev/null; then
205 eval `ssh-agent-manager -s`