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