# Languages options export LANG="de_DE" export LANGUAGE="de_DE" # zsh module autoload -U promptinit && promptinit autoload -U url-quote-magic && zle -N self-insert url-quote-magic autoload -U compinit && compinit # -- [[ Exports ]] -- # # # Use hard limits / smaller stack / no core dumps #unlimit #limit stack 8192 #limit core 0 #limit maxproc 50 #limit -s # -rw------- #umask 077 ## # Exports ## export MPD_HOST='westauto' export MPD_PORT=6600 export http_proxy='http://proxy.rz.uni-karlsruhe.de:3128' NNTPSERVER='news.aeton.de' && export NNTPSERVER if [[ "${OSTYPE}" == openbsd* ]]; then export PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386" fi export PATH=$PATH:~/bin/:~/.sh export MANPATH=/usr/share/man/:/usr/local/share/man/ export EDITOR="vim" export PAGER="less" export BROWSER="opera" export RLOGIN="ssh" export VISUAL=${EDITOR} export RSYNC_RSH=${RLOGIN} export CVS_RSH=${RLOGIN} export CVSEDITOR=${EDITOR} export MANWIDTH=80 export latitude="48.77861" export longitude="8.0797220000000003" #mailpath=(/home/manuel/Mail/inbox/new'?New mail in Inbox') LESS="-R -C -i -j4 -M -e -PM?m(%i/%m) .?f%f:Standard input.\: ?bb%bb?B/%B. Bytes.?pb (%pb\%).?lb, Zeile\: %lb?e ?x(-> %x):(EOF).%t" TIMEFMT="Real: %E User: %U System: %S Percent: %P Cmd: %J" # time(1) WATCHFMT="%B->%b %n has just %a %(l:tty%l:%U-Ghost-%u)%(m: from %m:)" # watch(1) HISTFILE=$HOME/.zshist SAVEHIST=500 HISTSIZE=800 TMPPREFIX=/tmp if [[ "${OSTYPE}" == openbsd* ]]; then export CVSROOT="anoncvs@openbsd.spline.de:/cvs" export LC_ALL=POSIX export PORTS_DIR="/usr/ports" #export CDPATH="$PORTS_DIR" fi if [ "$DISPLAY" = "screen" ]; then stty erase '^?' fi ## Farben fuer die prompt local black=$'%{\e[0;30m%}' local BLACK=$'%{\e[1;30m%}' local red=$'%{\e[0;31m%}' local RED=$'%{\e[1;31m%}' local green=$'%{\e[0;32m%}' local GREEN=$'%{\e[1;32m%}' local yellow=$'%{\e[0;33m%}' local YELLOW=$'%{\e[1;33m%}' local blue=$'%{\e[0;34m%}' local BLUE=$'%{\e[1;34m%}' local magenta=$'%{\e[0;35m%}' local MAGENTA=$'%{\e[1;35m%}' local cyan=$'%{\e[0;36m%}' local CYAN=$'%{\e[1;36m%}' local WHITE=$'%{\e[1;37m%}' local white=$'%{\e[0;37m%}' local nc=$'%{\e[0m%}' unset SCREENDIR ## # Prompt ## if [[ "$USERNAME" != "root" ]]; then PROMPT="${black}[$WHITE%~${black}]: $white" RPROMPT="" else PROMPT="${red}[$WHITE%~${red}]: $white" RPROMPT="" fi PS2="$RED%_ > $nc" PS3='> ' PS4='> ' SPROMPT=$'%BError!%b Correct %{\e[31m%}%R%{ \e[0m%}to%{ \e[36m%}%r%{\e[0m%}? [No/Yes/Abort/Edit]: ' setopt extendedglob # Prexec wird vor jedem "befehl" ausgeführt. preexec () { if [[ "$TERM" == "screen" ]]; then local CMD=${1[(wr)^(*=*|sudo|-*)]} echo -ne "\ek$CMD\e\\" fi } mcd(){ mkdir -p "$@"; cd "$@" } 2html(){ vim -u NONE -n -c ':syntax on' -c ':so $VIMRUNTIME/syntax/2html.vim' -c ':wqa' $1 > /dev/null 2> /dev/null } simple-extract (){ if [[ -f $1 ]] then case $1 in *.tar.bz2) bzip2 -v -d $1 ;; *.tar.gz) tar -xvzf $1 ;; *.rar) unrar $1 ;; *.deb) ar -x $1 ;; *.bz2) bzip2 -d $1 ;; *.lzh) lha x $1 ;; *.gz) gunzip -d $1 ;; *.tar) tar -xvf $1 ;; *.tgz) gunzip -d $1 ;; *.tbz2) tar -jxvf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *) echo "'$1' Error. Please go away" ;; esac else echo "'$1' is not a valid file" fi } ## # Alias ## alias do644="find . -type f -exec chmod 644 {} \;" alias do755="find . -type d -exec chmod 755 {} \;" alias vless=/usr/local/share/vim/vim71/macros/less.sh alias ls='ls --color -hF' alias ll='ls -l' alias lless='ls --color=never | less' alias m='cd /home/felix/Mail && mutt' alias cl='clear' alias df='df -h' alias mv='mv -i' alias du='du -h' alias size-dir="ls -a -c1 -s -h | sort +9.1b" alias size-dir-recursive="find . -type f | xargs ls -a -c1 -s -h | sort +9.1b" alias myip="lynx -source -dump http://ip.c0ders.org" alias www="cd ${htdocs}" alias ocd="cd ${OLDPWD}" alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias v="vim" alias mp3blaster="mp3blaster -f /tmp/irssiblaster" alias da="du -sch" alias j="jobs -l" alias 2mpg="ffmpeg -i ${1} -acodec mp3 -ab 128k ${1}.mpg" alias oports="netstat -ant | grep LISTEN" alias rw-='chmod 600' alias rwx='chmod 700' alias r--='chmod 644' alias r-x='chmod 755' alias mc='mc -b' alias show_tar="tar -tf" #alias scheck='servicecheck.pl ~/.servicecheck full' #alias ssh_c0ders="ssh c0ders.org -p 666" #alias py="env python" #alias df="colordf.pl -h" #alias killall="kill -9 \$(ps ax | fgrep $1 | cut -c1-6)" if [[ "{$OSTYPE}" == openbsd* ]]; then alias pkg_add='sudo pkg_add' alias pkg_delete='sudo pkg_delete' alias upsrc="cd /usr/src && cvs -q up -Pd" alias upports="cd /usr && cvs -q get -P ports" alias cdw="/var/www/htdocs/" fi ## # ls Colors ## LS_COLORS='' LS_COLORS=$LS_COLORS:'no=0' # Normal text = Default foreground LS_COLORS=$LS_COLORS:'fi=0' # Regular file = Default foreground LS_COLORS=$LS_COLORS:'di=34' # Directory = Bold, blue LS_COLORS=$LS_COLORS:'ln=01;36' # Symbolic link = Bold, Cyan LS_COLORS=$LS_COLORS:'pi=33' # Named pipe = Yellow LS_COLORS=$LS_COLORS:'so=01;35' # Socket = Bold, Magenta LS_COLORS=$LS_COLORS:'do=01;35' # DO = Bold, Magenta LS_COLORS=$LS_COLORS:'bd=01;37' # Block device = Bold, Grey LS_COLORS=$LS_COLORS:'cd=01;37' # Character device = Bold, Grey LS_COLORS=$LS_COLORS:'ex=35' # Executable file = Light, Blue LS_COLORS=$LS_COLORS:'*FAQ=31;7' # FAQs = Foreground Red, Background Black LS_COLORS=$LS_COLORS:'*README=31;7' # READMEs = Foreground Red, Background Black LS_COLORS=$LS_COLORS:'*INSTALL=31;7' # INSTALLs = Foreground Red, Background Black LS_COLORS=$LS_COLORS:'*.sh=47;31' # Shell-Scripts = Foreground White, Background Red LS_COLORS=$LS_COLORS:'*.vim=35' # Vim-"Scripts" = Purple LS_COLORS=$LS_COLORS:'*.torrent=4;33' # Torrents = Orange, Underline LS_COLORS=$LS_COLORS:'*.swp=00;44;37' # Swapfiles (Vim) = Foreground Blue, Background White LS_COLORS=$LS_COLORS:'*.sl=30;33' # Slang-Scripts = Yellow LS_COLORS=$LS_COLORS:'*,v=5;34;93' # Versioncontrols = Bold, Yellow LS_COLORS=$LS_COLORS:'or=01;05;31' # Orphaned link = Bold, Red, Flashing LS_COLORS=$LS_COLORS:'*.c=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.C=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.h=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.cc=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.awk=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.pl=1;33' # Sources = Bold, Yellow LS_COLORS=$LS_COLORS:'*.jpg=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.jpeg=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.JPG=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.gif=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.png=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.jpeg=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.ppm=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.pgm=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.pbm=1;32' # Images = Bold, Green LS_COLORS=$LS_COLORS:'*.tar=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.tgz=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.gz=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.zip=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.sit=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.lha=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.lzh=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.arj=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.bz2=31' # Archive = Red LS_COLORS=$LS_COLORS:'*.html=36' # HTML = Cyan LS_COLORS=$LS_COLORS:'*.htm=1;34' # HTML = Bold, Blue LS_COLORS=$LS_COLORS:'*.php=1;45' # PHP = White, Cyan LS_COLORS=$LS_COLORS:'*.doc=1;34' # MS-Word *lol* = Bold, Blue LS_COLORS=$LS_COLORS:'*.txt=1;34' # Plain/Text = Bold, Blue LS_COLORS=$LS_COLORS:'*.o=1;36' # Object-Files = Bold, Cyan LS_COLORS=$LS_COLORS:'*.a=1;36' # Shared-libs = Bold, Cyan ## # Bindeys ## case $TERM in xterm*) # Pos1 && End bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line ;; screen*) bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line ;; linux*) bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line ;; rxvt*) bindkey "^[[7~" beginning-of-line bindkey "^[[8~" end-of-line ;; Eterm*) bindkey "^[[7~" beginning-of-line bindkey "^[[8~" end-of-line ;; esac bindkey "^[[2~" yank # Einfg bindkey "^[[5~" up-line-or-history # PageUp bindkey "^[[6~" down-line-or-history # PageDown bindkey "^[e" expand-cmd-path # C-e for expanding path of typed command bindkey "^[[A" up-line-or-search # up arrow for back-history-search bindkey "^[[B" down-line-or-search # down arrow for fwd-history-search bindkey " " magic-space # do history expansion on space bindkey -v # vi keybindings bindkey "\e[3~" delete-char # "Entf" or "Del" bindkey "^[[A" history-search-backward # PgUp bindkey "^R" history-incremental-search-backward # Search in my $HISTFILE (STRG+R) bindkey '^Q' history-beginning-search-backward # bindkey '^F' history-beginning-search-forward # bindkey "^[[2;5~" insert-last-word # STRG+Einfg bindkey '^[[2' insert-last-word # STRG+Einfg bindkey "^B" backward-word # One word back bindkey "^X" forward-word # One word forward bindkey "^P" quote-line # quote the whole line bindkey "^K" run-help # i. e. "run-help foo" == "man foo" bindkey -s "\C-t" "dirs -v\rcd ~" # STRG+t bindkey "^I" expand-or-complete # assimilable to "ls" bindkey "^E" expand-cmd-path # $ ls == /bin/ls ## # Complitations ## zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(|.|..) ]] && reply=(..)' zstyle ':completion::complete:*' use-cache 1 zstyle ':completion:*:manuals' separate-sections true zstyle ':completion:*:descriptions' format $'%{\e[0;33m%}%d:%{\e[0m%}' zstyle ':completion:*' select-prompt %SScrolling active: current selection at %P Lines: %m zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%}' zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*:*:*:*:hosts' list-colors '=*=30;41' zstyle ':completion:*:*:*:*:users' list-colors '=*=34;47' zstyle ':completion:*:processes' command ps --forest -A -o pid,cmd zstyle ':completion:*:processes' list-colors '=(#b)( #[0-9]#)[^[/0-9a-zA-Z]#(*)=34=37;1=30;1' zstyle ':completion:*:(pkill|kill):*' menu yes select zstyle ':completion:*:kill:*' force-list always zstyle ':completion:*:(ssh|scp|ftp):*' menu yes select hosts $hosts zstyle ':completion:*:(ssh|scp|ftp):*' users $users zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' zstyle ':completion:*' file-sort name zstyle ':completion:*' menu select=long zstyle ':completion:*-case' menu select=5 zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.(o|c~|old|pro|zwc)' '*~' zstyle ':completion:*:messages' format $'%{\e[0;31m%}%d%{\e[0m%}' zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for: %d%{\e[0m%}' zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' zstyle ':completion:*' group-name '' zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories' zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG):ogg\ files *(-/):directories' zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS' zstyle ':completion:*:functions' ignored-patterns '_*' zstyle ':completion:::::' completer _complete _approximate zstyle ':completion:*:approximate:*' max-errors 2 zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters zstyle ':completion:*:expand:*' tag-order all-expansions