]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_zshrc
find-changed.pl
[sugar.git] / dot-files / _zshrc
1 #!/bin/zsh
2 bindkey -e
3
4 stty -ixon ixany
5 stty erase '^H'
6
7 setenv () { export $1="$@[2,-1]" }
8 unsetenv () { unset $1 }
9
10 #zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z} r:|[-_./]=* r:|=*'
11 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z} r:|[/]=* r:|=*'
12 zstyle ':completion:*' use-cache true
13
14 fpath=($HOME/.zfunc $fpath)
15 autoload -U ~/.zfunc/*(:t)
16 function r() {
17   local f
18   f=(~/.zfunc/*(.))
19   unfunction $f:t 2> /dev/null
20   autoload -U $f:t
21 }
22
23 _cache_hosts=(`perl -ne  'if (/^([a-zA-Z0-9.-]+)/) { print "$1\n";}' ~/.ssh/known_hosts`)
24
25 setopt no_beep
26 setopt auto_cd
27 setopt auto_list
28 setopt auto_menu
29 setopt auto_name_dirs
30 setopt auto_param_keys
31 setopt auto_param_slash
32 setopt auto_remove_slash
33 setopt c_bases
34 setopt chase_links
35 setopt complete_aliases
36 # setopt correct_all
37 setopt correct
38 setopt equals
39 setopt glob_complete
40 setopt prompt_bang
41 setopt prompt_percent
42 setopt prompt_subst
43 setopt pushd_ignore_dups
44 setopt pushd_to_home
45 setopt sh_file_expansion
46 setopt always_last_prompt
47 setopt extended_glob
48 setopt hist_ignore_all_dups
49 setopt hist_ignore_space
50 setopt inc_append_history
51 setopt share_history
52
53 PROMPT=$'%{\ek\e\\%}%B[%n@%m] %#%b '
54 RPROMPT='%U%?%u %U%D{%m/%d}%u %U%D{%T}%u %U%~%u'
55 HISTFILE="$HOME/.zhistory"
56 HISTSIZE=6000000
57 SAVEHIST=6000000
58
59 alias -g L="| $PAGER"
60 alias -g G="| grep"
61 alias -g H="| head"
62 alias -g T="| tail"
63
64 alias ..='cd ..'
65 alias cd..='cd ..'
66 alias cp='cp -i'
67 alias mv='mv -i'
68 alias ls='ls -wF'
69 alias la='ls -wa'
70 alias l='ls -wl'
71 alias lls='ls -wla'
72 alias p='pushd'
73 alias o='popd'
74 alias d='dirs'
75 alias top='top -X -s 7 -ocpu -Otime -F -R -t'
76 alias unstuff='open -a StuffIt\ Expander.app'
77 alias pa='open -a NiseRingo.app'
78 alias df='df -h'
79 alias ed='ed -p "ed> "'
80 alias du='du -k'
81 alias nc='nc -vv'
82 alias mwget="wget --user-agent='Mozilla/1.4b'"
83 alias pstow="pushd /usr/local/stow"
84 alias safari="open -a Safari"
85 alias w3m="w3m -O UTF-8"
86 alias w3mb="w3m -O UTF-8 -B"
87 alias ldd="otool -L"
88 alias cmus="cmus 2>/dev/null"
89 alias heboris='open /Applications/HeborisUEMac/exe/Heboris\ OpenGL.app'
90
91 function openurl {
92     `firefox -remote "openurl($1,new-tab)"`
93 }
94
95 function keepnice20 {
96     sudo nice -n -20 sudo -u ${USER} $@
97 }
98
99 alias startcow='cd ~/Applications/dnetc*; ./dnetc -shutdown; ./dnetc'
100 alias pausecow='~/Applications/dnetc*/dnetc -pause'
101 alias resumecow='~/Applications/dnetc*/dnetc -unpause'
102
103 alias startnekoko='cd ~/development/NekokoAndShota; ./nekosho -d nekoko-ord'
104 alias startshota='cd ~/development/NekokoAndShota; ./nekosho -d shota-ord'
105
106 alias startbottle='cd ~/development/bottleuploadcatcher; ./catcher'
107
108 #alias tome='open ~/Applications/ToME*/T.o.M.E.*'
109 alias hengband='open ~/Applications/hengband*/Hengband*'
110
111 function verbose_comp {
112     zstyle ':completion:*' verbose yes
113     zstyle ':completion:*:descriptions' format '%B%d%b'
114     zstyle ':completion:*:messages' format '%d'
115     zstyle ':completion:*:warnings' format 'No matches for: %d'
116     zstyle ':completion:*' group-name ''
117 }
118 verbose_comp
119
120 # The following lines were added by compinstall
121
122 zstyle :compinstall filename '/Users/admin/.zshrc'
123
124 autoload -U compinit
125 compinit
126 # End of lines added by compinstall
127
128 if [ "x$WINDOW" = "x" ]; then
129     fortune
130 fi
131
132 if [ -e ".motd" ]; then
133     cat .motd
134 fi
135
136 function initscreen {
137     case "x$WINDOW" in
138         "x0")
139             top;;
140         "x1")
141             cd ~/sandbox/impfarm/client && \
142                 echo "Type ./impfarm.sh to start IMP";;
143         "x2")
144             cd ~/var/futasuke;;
145         "x3")
146             cd ~/var/folding-at-home;;
147             #cd ~/var/futasuke && \
148 #               echo "Type ./start.sh to start futasuke";;
149     esac
150 }
151 if [ "x$WINDOW" != "x" ] && [ "x$INITSCREEN" != "xdone" ]; then
152     export INITSCREEN="done"
153     initscreen
154 fi
155
156 #if [ "$DISPLAY" = "" ]; then
157 #    export DISPLAY=":0.0"
158 #fi
159
160 eval `ssh-agent-manager -s`