#!/bin/zsh setopt auto_cd extended_glob auto_pushd pushd_ignore_dups setopt hist_ignore_all_dups append_history extended_history hist_reduce_blanks setopt correct complete_in_word setopt prompt_subst transient_rprompt HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=12000 DOMAIN=`hostname -f` eval `dircolors` eval `lesspipe` export EDITOR="emacsclient -a '' -nw" export PAGER=less export LESS_TERMCAP_mb=$'\e[01;31m' export LESS_TERMCAP_md=$'\e[01;31m' export LESS_TERMCAP_me=$'\e[0m' export LESS_TERMCAP_se=$'\e[0m' export LESS_TERMCAP_so=$'\e[01;44;33m' export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_us=$'\e[01;32m' autoload -Uz compinit autoload -Uz vcs_info autoload -Uz colors compinit vcs_info colors zmodload -i zsh/complist _force_rehash() { if (( CURRENT == 1 )); then rehash fi # We didn't really complete anything. return 1 } zstyle :compinstall filename '/home/christoph/.zshrc' zstyle ':completion:*' menu select=3 zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2|_uni|_debian)(N) /dev/null)"}%%[# ]*}//,/ })' zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:::::' completer _force_rehash _complete _approximate _expand _ignored zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )' zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-z}={A-Z}' bindkey -e bindkey 'e' backward-word bindkey 'f' forward-word bindkey '' down-line-or-search bindkey '' up-line-or-search bindkey '[28~' run-help setWindowTitle(){ echo -e '\033]0;'$1'\007' } precmd () { vcs_info setWindowTitle ${USER}@${HOST} if [[ $UID == 0 && $+commands[systemctl] != 0 ]] then use_systemd=true systemd_failed="`systemctl --state=failed | grep failed | cut -d \ -f 2 | tr '\n' ' '`" fi } config=("default" "`uname -s`") case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in (*.debian.org) export EMAIL=christoph@debian.org config=($config debian) ;; (faui49*.uni-erlangen.de) export EMAIL=Christoph.Egger@cs.fau.de config=($config i4lab) ;; (faui0*.informatik.uni-erlangen.de|faui48*.informatik.uni-erlangen.de) export EMAIL=siccegge@cs.fau.de config=($config cip) ;; (*.siccegge.de) export MAIL=christoph@christoph-egger.org config=($config home) ;; esac if [[ $UID == 0 && $+commands[systemctl] != 0 ]] then PROMPT=$'%{$fg[red]>> $systemd_failed$reset_color%}\n' else PROMPT="" fi PROMPT+=$'%{$fg[yellow]%}%n@%{$fg[magenta]%}%m%{$reset_color%} %~ \n%{$fg[cyan]%}%T%{$reset_color%} %0(?,%{$fg[green]%},%{$fg[red]%}%s)%?%{$reset_color%} %# ' RPROMPT='${vcs_info_msg_0_}' export DEBEMAIL='christoph@debian.org' export DEBFULLNAME='Christoph Egger' export DEB_BUILD_OPTIONS="parallel=$(getconf _NPROCESSORS_ONLN)" for ftype in aliases includes do for location in $config do if [ -f ~/.zsh/${ftype}/${location}.zsh ] then source ~/.zsh/${ftype}/${location}.zsh fi done done karma () { gpg --fingerprint $1 >> ${HOME}/karma printf '\n-----\n\n' >> ${HOME}/karma } gpgrefresh () { gpg --refresh-keys 2>&1 | grep -v 'nicht geƤndert' } sponsor() { pkgname=`echo $i | rcut -d '/' -f 1 | cut -d '_' -f 1` apt-get --download-only -t unstable $pkgname dget $i } path=(${HOME}/bin $path) fpath=(${HOME}/.zsh/functions/$CONFIG ${HOME}/.zsh/functions/default $fpath) export PATH export FPATH alias wb="ssh -t buildd.debian.org wb" # remove word, not including / function _backward_kill_default_word() { WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' zle backward-kill-word } zle -N backward-kill-default-word _backward_kill_default_word bindkey -e '\e=' backward-kill-default-word