3 setopt no_always_last_prompt
9 setopt hist_ignore_all_dups
14 setopt autopushd pushdminus pushdsilent pushdtohome
21 # I used to use xv to often...
24 alias lterm="export TERM=linux"
25 alias ll="ls -al --color"
27 alias l="ls -a --color"
28 #alias ll="/bin/ls -al"
31 # export LYNX_CFG=~/.lynxrc
32 alias lynx="noglob command lynx -cfg=~/.lynxrc"
34 ### ENVIRONMENT VARIABLES
35 LC_COLLATE=C ; export LC_COLLATE
37 # export LANG=de_DE@euro
39 export LC_MESSAGES=en_US
41 export ORACLE_HOME=/home/oracle/OraHome1
42 # export ORACLE_SID=whatever
59 white_on_blue='%{
\e[0;37;44m%}'
63 magenta='%{
\e[0;35m%}'
69 if [ "$TERM" = "xterm-debian" ] ; then
71 echo -n "
\e]2;$LOGNAME@$(hostname): $(pwd)
\a"
76 RPROMPT='%{
\e[0;33m%}%1v%{
\e[0m%}'
78 export HISTFILE=~/.zshhistory
81 export NNTPSERVER=picard.franken.de
83 export PATH="/usr/lib/compilercache:$JAVA_HOME/bin:/home/tkoehler/bin:/usr/local/bin/X11:/usr/local/bin:/bin:/usr/X11R6/bin:/usr/bin:/usr/sbin:/usr/bin/X11:/local/bin:/usr/games:/usr/lib/mutt:${ORACLE_HOME}/bin:/usr/lib/ICAClient:/usr/local/sap/SAPGUI/6.30/bin"
85 VIM=/usr/local/share/vim
88 # alias JAVA_HOME="export JAVA_HOME=/usr/lib/jdk1.1/"
89 export JAVA_HOME=/usr/local/java/j2sdk1.4.2_01
92 #### PLATINHOME="/usr/local/sap/SAPGUI/6.30/"
93 PLATIN_JAVA="/usr/local/java/j2sdk1.4.2_01/bin/java"
95 ### export PLATINHOME PLATIN_JAVA PLATIN_JAVA_VER
96 export PLATIN_JAVA PLATIN_JAVA_VER
97 export EDITOR=/usr/local/bin/vim
98 export SLANG_EDITOR="/usr/local/bin/vim %s"
100 export MOZILLA_HOME="/usr/local/netscape"
102 export QTDIR PATH MANPATH LD_LIBRARY_PATH LIBRARY_PATH
103 export CPLUS_INCLUDE_PATH
105 export IRCNAME="http://jeanluc-picard.de/irc.html"
108 export LD_LIBRARY_PATH=/home/tkoehler/lib:/home/oracle/OraHome1/lib/
114 ZLS_COLOURS="no=36;40:fi=36;40:di=32;40:ln=33;40:pi=31;40:so=22;40:bd=44;37:cd=44;37:ex=35;40:mi=36;40:lc=\e[:rc=m:mi=37;41"
115 LS_COLORS=$ZLS_COLOURS
117 #### muß mal noch rausfinden, warum die hier in ganz neuen zsh-Versionen nicht
120 # no 0 for normal text (i.e. when displaying something
121 # other than a matched file)
122 # fi 0 for regular files
123 # di 32 for directories
124 # ln 36 for symbolic links
125 # pi 31 for named pipes (FIFOs)
130 # for character devices
131 # ex 35 for executable files
133 # for non-existent file (default is the value defined
135 # lc \e[ for the left code (see below)
136 # rc m for the right code
139 MANPATH=/usr/man:/usr/share/man:/usr/X11R6/man:/usr/local/man
145 x() { a=$1 ; shift ; echo "$@" | xargs $a }
147 if [ -f $HOME/.ssh/agent_var ] ; then
148 . $HOME/.ssh/agent_var
152 if kill -0 $SSH_AGENT_PID ; then
156 ssh-add $HOME/.ssh/id_rsa
157 touch $HOME/.ssh/agent_var ; chmod 600 $HOME/.ssh/agent_var
158 echo "export SSH_AGENT_PID=$SSH_AGENT_PID" > $HOME/.ssh/agent_var
159 echo "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $HOME/.ssh/agent_var
163 if [ -z "$SSH_AGENT_PID" ] ; then
168 if [ -z "$1" ] ; then
169 echo "Usage: archive_this_dir LABEL"
172 ARCHIVE_TO_CD $1 $PWD 0xEA8CFEDE
175 archive_this_dir_as_pics() {
176 if [ -z "$1" ] ; then
177 echo "Usage: archive_this_dir_as_pics LABEL"
180 ARCHIVE_PICTURES_TO_CD $1 $PWD 0xEA8CFEDE
184 gpg --keyserver wwwkeys.pgp.net --keyserver-options honor-http-proxy --recv-keys $@
187 ### highlight current line's {} pairs
188 ### yes, this functions doesn't work correct in all situations,
189 ### but it's a nice thing
195 while [ $i -le $strlen ] ; do
199 (\{) j=$[j+1] ; eval print -n $"COLOR$j"$"x"$"COLOROFF" ;;
200 (\}) eval print -n $"COLOR$j"$"x"$"COLOROFF" ; j=$[j-1] ;;
208 vim -c "se tw=70" `date +%Y%m%d-%R`.txt
211 ### set xterm's icon text, its titletext, or both at once
213 print "\033]1;$@\007"
216 print "\033]2;$@\007"
219 print "\033]0;$@\007"
222 ### a function for setting up proxy settings
224 export http_proxy="http://proxy:3128"
225 export https_proxy="http://proxy:3128"
226 export ftp_proxy="http://proxy:3128"
229 namedir () { eval "$1=$PWD" ; eval "echo ~$1" }
231 ### run help on a vim help topic
232 vimhelp () { vim -c "help $1" -c on -c "au! VimEnter *" }
233 gvimhelp () { gvim -c "help $1" -c on -c "au! VimEnter *" }
236 LANG=C command acroread $@
239 LANG=de_DE command galeon $@
242 LANG=en command aumix $@
245 command startx "$@" >& ~/.startx.out
250 # echo -n "
\e]2;$LOGNAME@$(hostname): $(pwd)\a"
251 # if [ "$TERM" = "screen-w" ] ; then
252 # perl ~/bin/screen_hardstatus.pl $MYTTY $USER $HOST &!
253 # PROMPT=$(perl ~/bin/screen_hardstatus.pl " " $USER $HOST $ZSH_VERSION)
254 apm=$(apm|sed -e 's/%/%%/')
255 PROMPT="${green}$(uptime) $nocolor
256 ${white_on_blue}--INSERT--${cyan} zsh version: $ZSH_VERSION $yellow Return Code: %? $nocolor
257 $blue%h $red%n@%m ${yellow}TTY:%l$cyan - $apm
259 # PROMPT="$PROMPT$WHO\n"
263 (*running*suspended*)
264 psvar[1]="There are running and stopped jobs.";;
265 (*suspended*running*)
266 psvar[1]="There are running and stopped jobs.";;
268 psvar[1]="There are stopped jobs.";;
270 psvar[1]="There are running jobs.";;
278 typeset -x -A tmpstates
279 for i in $jobstates[(I)*]
281 tmpstates[$i]=$jobstates[$i]
283 for i in $tmpstates[(I)*]
285 echo "[$i]\t$tmpstates[$i]"
286 done | sort -n | less
290 function dmalloc { eval `command dmalloc -b $*` }
296 bindkey "
\e[A" history-beginning-search-backward
297 bindkey "
\e[B" history-beginning-search-forward
298 bindkey "
\e[C" forward-char
299 bindkey "
\e[D" backward-char
300 bindkey "^Xq" push-line
301 bindkey "^Xr" history-incremental-search-backward
302 bindkey "^Xs" history-incremental-search-forward
303 bindkey "^X_" insert-last-word
304 bindkey "^Xa" accept-and-hold
305 bindkey "^X^H" run-help
306 bindkey "^Xh" _complete_help
307 bindkey "^I" expand-or-complete
308 bindkey "^E" expand-word
309 bindkey "^N" menu-complete
310 bindkey "^P" reverse-menu-complete
311 bindkey -M vicmd "^R" redo
312 bindkey -M vicmd "u" undo
313 bindkey -M vicmd "ga" what-cursor-position
316 ### VI MODE EXTENSIONS
318 builtin zle .redisplay
320 # echo -n "\033[$L;0;H"
321 ( true ; show_mode "INSERT") &!
324 builtin zle .redisplay
326 # echo -n "\033[$L;0;H"
327 (true ; show_mode "NORMAL") &!
331 bindkey -M viins "^X^R" redisplay
332 bindkey -M vicmd "^X^R" redisplay2
335 echo -n "\033[2J\033[400H"
336 #repeat $[LINES - 2] echo
337 builtin zle .redisplay
338 # builtin zle .clear-screen
339 (true ; show_mode "INSERT") &!
342 bindkey "
\f" screenclear
347 local MYLINE="$LBUFFER$RBUFFER"
350 builtin zle redisplay
352 # print "${COLORX}Hit Enter to continue${COLOROFF}"
356 bindkey "^Xl" screenclearx
357 #bindkey "^L" screenclearx
366 #x=$(wc -l $PREBUFFER)
367 x=$(echo $PREBUFFER | wc -l )
369 # echo -n "
\e7
\e[0;$COL;H"
370 echo -n "
\e7
\e[$x;A
\e[0;G"
373 # echo -n "
\e7
\e[5A
\e[0$c"
374 echo -n "
\e[0;37;44m--$1--
\e[0m"
378 ### vi-add-eol (unbound) (A) (unbound)
379 ### Move to the end of the line and enter insert mode.
383 builtin zle .vi-add-eol
386 bindkey -M vicmd "A" vi-add-eol
388 ### vi-add-next (unbound) (a) (unbound)
389 ### Enter insert mode after the current cursor posi
390 ### tion, without changing lines.
394 builtin zle .vi-add-next
395 # OLDLBUFFER=$LBUFFER
396 # OLDRBUFFER=$RBUFFER
398 # bindkey -M viins "
\e" vi-cmd-mode-a
401 bindkey -M vicmd "a" vi-add-next
405 # STRING="LLBUFFER=\${LBUFFER:s/$OLDLBUFFER//}"
407 # STRING="RRBUFFER=\${RBUFFER:s/$OLDRBUFFER/}"
409 # INS="$LLBUFFER$RRBUFFER"
410 # LBUFFER=$OLDLBUFFER
411 # repeat $NNUMERIC LBUFFER="$LBUFFER$INS"
412 # builtin zle .vi-cmd-mode
413 # unset LLBUFFER RRBUFFER NNUMERIC INS
414 # bindkey -M viins "
\e" vi-cmd-mode
416 #zle -N vi-cmd-mode-a
418 ### vi-change (unbound) (c) (unbound)
419 ### Read a movement command from the keyboard, and kill
420 ### from the cursor position to the endpoint of the
421 ### movement. Then enter insert mode. If the command
422 ### is vi-change, change the current line.
426 builtin zle .vi-change
429 bindkey -M vicmd "c" vi-change
431 ### vi-change-eol (unbound) (C) (unbound)
432 ### Kill to the end of the line and enter insert mode.
436 builtin zle .vi-change-eol
439 bindkey -M vicmd "C" vi-change-eol
441 ### vi-change-whole-line (unbound) (S) (unbound)
442 ### Kill the current line and enter insert mode.
444 vi-change-whole-line() {
446 builtin zle .vi-change-whole-line
448 zle -N vi-change-whole-line
449 bindkey -M vicmd "S" vi-change-whole-line
451 ### vi-insert (unbound) (i) (unbound)
452 ### Enter insert mode.
456 builtin zle .vi-insert
459 bindkey -M vicmd "i" vi-insert
461 ### vi-insert-bol (unbound) (I) (unbound)
462 ### Move to the first non-blank character on the line
463 ### and enter insert mode.
467 builtin zle .vi-insert-bol
470 bindkey -M vicmd "I" vi-insert-bol
472 ### vi-open-line-above (unbound) (O) (unbound)
473 ### Open a line above the cursor and enter insert mode.
475 vi-open-line-above() {
477 builtin zle .vi-open-line-above
479 zle -N vi-open-line-above
480 bindkey -M vicmd "O" vi-open-line-above
482 ### vi-open-line-below (unbound) (o) (unbound)
483 ### Open a line below the cursor and enter insert mode.
485 vi-open-line-below() {
487 builtin zle .vi-open-line-below
489 zle -N vi-open-line-below
490 bindkey -M vicmd "o" vi-open-line-below
492 ### vi-substitute (unbound) (s) (unbound)
493 ### Substitute the next character(s).
497 builtin zle .vi-substitute
500 bindkey -M vicmd "s" vi-substitute
503 ### vi-replace (unbound) (R) (unbound)
504 ### Enter overwrite mode.
509 builtin zle .vi-replace
512 bindkey -M vicmd "R" vi-replace
514 ### vi-cmd-mode (^X^V) (unbound) (^[)
515 ### Enter command mode; that is, select the `vicmd'
516 ### keymap. Yes, this is bound by default in emacs
521 builtin zle .vi-cmd-mode
524 bindkey -M viins "
\e" vi-cmd-mode
528 ### vi-oper-swap-case
529 ### Read a movement command from the keyboard, and swap
530 ### the case of all characters from the cursor position
531 ### to the endpoint of the movement. If the movement
532 ### command is vi-oper-swap-case, swap the case of all
533 ### characters on the current line.
536 bindkey -M vicmd "g~" vi-oper-swap-case
541 zmodload zsh/parameter
550 # create iab's for my mutt-aliases to be sourced from within vim
551 # cat ~/.muttrc.aliases | sed -e 's/^#/"/' -e 's/^alias/iab/' > ~/.vim_mutt.aliases
553 # Colourize cursor on Linux console
554 # echo -e "\033[?17;216;64c"
555 # echo -e "\033[?17;215;55c"
557 ###### ### a clock in the prompt. Yes, this _is_ cool. But sometimes, it interferes with
558 ###### ### other things.
559 ###### ### I no longer need it as I have a running clock on my desktop when running
560 ###### ### X and a clock in screen's hardstatus line when running on the console
561 ###### trap CRON ALRM
567 ###### STRING=$(date)
568 ###### COL=$[COLUMNS-5]
569 ###### COL=$[COL-$#STRING]
570 ###### x=$(echo $PREBUFFER | wc -l )
572 ###### echo -n "
\e7
\e[$x;A
\e[$COL;G
\e[0;37;44m-- $STRING --
\e[0m
\e8"
575 ### thanks to Riviera for this one...
576 ### don't use it at the moment
577 #*Riviera* chpwd () {
578 #*Riviera* dirs >| $ZDOTDIR/zsave/zsh_dirstack_tty$tti
581 #*Riviera* cd $(cut -d\ -f1 ~/.zsh/zsave/zsh_dirstack_tty$1|sed s/~/${HOME:gs./.\\\\/}/g)
585 #*Riviera* dirs $(sed s/~/${HOME:gs./.\\\\/}/g $ZDOTDIR/zsave/zsh_dirstack_tty$tti)
586 #*Riviera* und in .zlogout nochmal das, was in chpwd steht.
588 #*Riviera* Damit kann ich 1. mit "cdt 3" in das in tty3 aktuelle Verzeichnis wechseln
589 #*Riviera* und 2. nach nem login wieder denselben dirstack vorfinden auf derselben tty wie vorm ausloggen.
590 #*Riviera* tti=$(tty)
591 #*Riviera* tti=${tti#*/dev/tty}
592 #*Riviera* Kommt noch dazu. Eigentlich hatte ich dann immer noch
593 #*Riviera* case $tti in
594 #*Riviera* [A-Za-z]*)tti=${tti%*[0-9]};;
597 #*Riviera* aber das hab ich rausgenommen
601 ### COMPLETION AND MORE
603 # The following lines were added by compinstall
604 [[ -z $fpath[(r)$_compdir] ]] && fpath=($fpath $_compdir)
605 #fpath=(/home/tkoehler/zsh/foo $fpath)
611 _myhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
612 # zstyle ':completion:*' hosts $_myhosts
614 zstyle ':completion:*' auto-description 'specify %d'
615 zstyle ':completion:*' completer _complete _ignored _match _correct _approximate _prefix
616 zstyle ':completion:*' file-sort name
617 zstyle ':completion:*' format 'Completing %d'
618 zstyle ':completion:*' group-name ''
619 ## domains to use for mutt user@host<TAB> completion
620 zstyle '*mutt*' hosts 'picard.franken.de' 'vim.org'
621 zstyle '*' hosts 'picard.franken.de' 'unser.linux.laeuft.auf.s390.org'
622 zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
623 zstyle ':completion:*' matcher-list 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' 'm:{a-z}={A-Z}'
624 zstyle ':completion:*' match-original both
625 zstyle ':completion:*' max-errors 3
626 zstyle ':completion:*' menu select=0
627 zstyle ':completion:*' prompt 'CORRECT (%e errors found) > '
628 zstyle ':completion:*' special-dirs true
629 zstyle ':completion:*' squeeze-slashes true
630 zstyle '*mutt*' users vim vim-dev tkoehler
631 zstyle '*' users thomas tkoehler
632 zstyle ':completion:*' verbose true
633 zstyle :compinstall filename '/home/tkoehler/.zshrc'
634 # End of lines added by compinstall
635 #fpath=(/usr/share/doc/zsh/examples/Functions/Misc/ $fpath)
639 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
640 zstyle ':completion:*:*:*:*:hosts' list-colors '=(#b)(*)(to.com)=34;40=35;40' '=(#b)(*)(mayn.de)=36;40=35;40' '=unser.linux.laeuft.auf.s390.org=33;40' '=*=31;40'
641 zstyle ':completion:*:*:*:*:users' list-colors '=*=32;40'