2 # I got this file from someone (don't remember who though)
5 # Arne Schwabe <arne@rfc2549.org>
7 # But some credit still goes to (and others):
9 # zshrc - by trey tabner. email: trey@epicsol.org irc: icetrey@efnet
10 # not all of this is mine, a few of the completions are taken from old examples :)
12 hosts=( news mailrapid mailgate mailgate2 mailserv \
13 leros atreus monkey-island \
14 ilum r2d2 kamino geonosis coruscant.rfc1149.org \
15 info-stud info-e info-f angkor-vat athene webserv \
16 naxos simon-the-sorcerer the-little-computer-project pissarro \
17 kevin feivel orang-utan-klaus \
18 queaker debian.ventourizen.de fireball \
19 debian.ventourizen.de queaker )
22 alias dos2unix='recode ibmpc:lat1'
23 alias unix2dos='recode la1:imbpc'
25 if [[ -e /usr/local/maple8-8.01/bin/ ]]; then
26 alias maple=/usr/local/maple8-8.01/bin/maple
27 alias xmaple=/usr/local/maple8-8.01/bin/xmaple
30 #alias kernel='finger @finger.kernel.org'
35 lynx='lynx -accept_all_cookies'
37 alias lowercase='for i in [A-Z][A-Z]*(.); do mv "$i" "${i:l}" ;done'
38 alias bt='PORT=$RANDOM; btdownloadcurses.py --max_upload_rate 3 --minport $(($PORT+1400)) --maxport $(($PORT + 1410))'
39 alias btu='PORT=$RANDOM; btdownloadcurses.py --max_upload_rate 100 --minport $(($PORT+1400)) --maxport $(($PORT + 1410))'
40 alias bto='PORT=$RANDOM; btdownloadcurses.py --max_upload_rate 13 --minport $(($PORT+1400)) --maxport $(($PORT + 1410))'
41 alias mgqueue='ssh mailgate /home/mail/exim/bin/exim -C /home/mail/exim/configure.outgoing -bpc'
42 alias acroread="LANG=de_DE acroread"
44 export HISTFILE=$HOME/.zshhistory
51 export LANG=de_DE.UTF-8
84 NO_csh_junkie_quotes \
98 NO_hist_allow_clobber \
107 interactive_comments \
134 NO_sh_file_expansion \
140 NO_sun_keyboard_hack \
148 # From zefram Prompt and heavily modified (you did not expect anything else, did you)
149 # The screen and preexec thing came from www.zshwiki.org/cgi-bin/wiki.pl?ZshHardStatus
153 function title () {print -nP '\e]0;'$*'\a'}
157 print -nPR $'\033k'$1$'\033'\\
158 print -nPR $'\033]0;'$2$'\a'
168 function prompt_arne_zefram_precmd {
171 [[ $exitstatus -gt 128 ]] && psvar[1]=SIG$signals[$exitstatus-127]
172 [[ $psvar[1] = SIG ]] && psvar[1]=$exitstatus
173 jobs % >/dev/null 2>&1 && psvar[2]=
175 title "%n@%m:%20<...<%3~%<<"
178 function prompt_arne_zefram_setup {
179 PS1='[%(00t.DING%(0T. DONG.)!.%T)]%(?..%U{%v}%u)%(!..%n%(2v.%B@%b.@))%m:%20<...<%3~%<<%# '
180 PS2='%(4_:... :)%3_> '
182 prompt_opts=( cr subst percent )
183 precmd () { prompt_arne_zefram_precmd }
186 local -a cmd; cmd=(${(z)1})
187 title %n@%m:$cmd[1]:t "$cmd[2,-1]"
191 function prompt_arne_zefram_setup3 {
192 prompt_arne_zefram_setup
193 function preexec() {}
196 if [[ $USER != root ]]; then
197 if [[ "$SSH_AUTH_SOCK" == "" && -f ~/.ssh/.agent-$HOST ]]; then
198 echo -n "Reused PID: "
199 source ~/.ssh/.agent-$HOST
203 ssh-add -l 2> /dev/null # | cut -d" " -f1,3,4
205 if [[ $? == 1 || $? == 0 ]] then
206 #echo ssh agent reused
209 if [[ -f ~/.ssh/.agent-$HOST ]]; then
210 rm ~/.ssh/.agent-$HOST
212 ssh-agent > ~/.ssh/.agent-$HOST
213 source ~/.ssh/.agent-$HOST
218 if [[ $OSTYPE = 'linux-gnu' ]]; then
219 filesystems="${${(f)$(</proc/filesystems)}#* }"
221 setterm -hbcolor bright white
222 setterm -ulcolor cyan
224 alias ls='ls --color=auto'
228 # FreeBSD seems to be more clever, so I move this to Linux
229 export PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
230 if [ -d ~/bin ]; then
231 PATH="$HOME/bin:${PATH}"
234 # Sigh, I have far _too_ many GNUism in my config
235 elif test `uname` = 'FreeBSD'; then
236 # No PATH setting :)))
242 echo $(($(sysctl hw.acpi.thermal.tz0.temperature \
243 | cut -d " " -f 2) / 10.0 - 273.15))
245 elif test `uname` = 'SunOS'; then
246 PATH=/usr/sbin/:/usr/bin
247 if [ -e /usr/pkg ]; then
248 PATH=${PATH}:/usr/pkg/bin:/usr/pkg/sbin
249 MANPATH=${MANPATH}:/usr/pkg/man
251 PATH=${PATH}:/opt/SUNWspro/bin
252 PATH=${PATH}:/usr/local/bin
253 PATH=${PATH}:/usr/ccs/bin/:usr/ccs/lib
254 PATH=${PATH}:/opt/sfw/bin
256 if [ "DISPLAY" != "" ]; then
257 PATH=${PATH}:/usr/dt/bin
258 PATH=${PATH}:/usr/openwin/bin
264 if [[ $HOST == "coruscant" ]]; then
265 export CVSROOT="/var/lib/cvs"
267 export CVSROOT=":pserver:arne@coruscant.rfc1149.org:/var/lib/cvs"
271 if test $HOST = "mailrapid" || test $HOST = "mailgate" || test $HOST = "mailgate2" || test $HOST = "mailrapid2" ; then
272 export PATH=/home/mail/bin:$PATH
273 if test $HOST = "mailrapid" ; then
274 export PATH=$PATH:/var/mailman/bin
281 bindkey -s '^X^Z' '%-^M'
282 bindkey '^[e' expand-cmd-path
283 bindkey -s '^X?' '\eb=\ef\C-x*'
284 bindkey '^[^I' reverse-menu-complete
285 bindkey '^[p' history-beginning-search-backward
286 bindkey '^[n' history-beginning-search-forward
288 bindkey '^p' history-beginning-search-backward
289 bindkey '^n' history-beginning-search-forward
290 bindkey '^[[A' history-beginning-search-backward
291 bindkey '^[[B' history-beginning-search-forward
293 bindkey '^W' kill-region
294 bindkey '^I' expand-or-complete-prefix
295 bindkey -s '^[[Z' '\t'
298 bindkey "\e[4~" end-of-line
299 bindkey "^[[8~" end-of-line
301 bindkey "^[[1~" beginning-of-line
302 bindkey "^[[7~" beginning-of-line
304 if [[ ${ZSH_VERSION%%.*} -ge 4 ]]; then
305 zstyle :compinstall filename '/home/arne/.zshrc'
306 zstyle '*' hosts $hosts
307 prompt_arne_zefram_setup
315 prompt_arne_zefram_setup3
318 ## Orginal Source Code of the Clock:
319 ## Thomas Köhler also has a .zshrc: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/zsh/u
320 # Modified to fit to my prompt
321 # Does not work so good :/
326 #function uhrzeit() {
327 # print -nP "\e7\e[1;G"
329 # print -nP "[%(00t.DING%(0T. DONG.)!.%T)]"
330 # # restore cursor position
340 printf 'GET /kdist/finger_banner HTTP1.0\n\n' | nc www.kernel.org 80 | grep latest
343 function http_header()
345 # This is zsh but still no gnu echoism ;P
346 if [[ $2 != "" ]] { port=$2 } else { port=80 }
347 if [[ $3 != "" ]] { vhost="$3" } else { vhost=$1 }
349 printf "HEAD /$4 HTTP/1.1\\nHost: $vhost\nConnection: close\n\n" \
354 function setenv() { export $1="$2" }
355 function unsetenv() { unset $1 }