]> git.siccegge.de Git - dotfiles/zsh.git/blob - zshrc
abd47ce5a61cbf00d758a90a76009d23573bc82b
[dotfiles/zsh.git] / zshrc
1 #!/bin/zsh
2
3 setopt auto_cd extended_glob auto_pushd pushd_ignore_dups
4 setopt hist_ignore_all_dups append_history extended_history hist_reduce_blanks
5 setopt correct complete_in_word
6 setopt prompt_subst transient_rprompt
7
8 HISTFILE=~/.histfile
9 HISTSIZE=10000
10 SAVEHIST=12000
11 DOMAIN=`hostname -f`
12
13 eval `dircolors`
14 eval `lesspipe`
15
16 export EDITOR="emacsclient -a '' -nw"
17 export PAGER=less
18
19 export LESS_TERMCAP_mb=$'\e[01;31m'
20 export LESS_TERMCAP_md=$'\e[01;31m'
21 export LESS_TERMCAP_me=$'\e[0m'
22 export LESS_TERMCAP_se=$'\e[0m'
23 export LESS_TERMCAP_so=$'\e[01;44;33m'
24 export LESS_TERMCAP_ue=$'\e[0m'
25 export LESS_TERMCAP_us=$'\e[01;32m'
26
27 autoload -Uz compinit
28 autoload -Uz vcs_info
29 autoload -Uz colors
30
31 compinit
32 vcs_info
33 colors
34
35 zmodload -i zsh/complist
36
37 zstyle :compinstall filename '/home/christoph/.zshrc'
38 zstyle ':completion:*' menu select=3
39 zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2|_uni|_debian)(N) /dev/null)"}%%[# ]*}//,/ })'
40 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
41
42 bindkey -e
43 bindkey '\ee' backward-word
44 bindkey '\ef' forward-word
45 bindkey '\e[B' down-line-or-search
46 bindkey '\e[A' up-line-or-search
47 bindkey '\e[28~' run-help
48
49
50
51 setWindowTitle(){
52 echo -e '\033]0;'$1'\007'
53 }
54
55 precmd () {
56 vcs_info
57 setWindowTitle ${USER}@${HOST}
58
59 if [[ $UID == 0 && -f `which systemctl` ]]
60 then
61 use_systemd=true
62 systemd_failed="`systemctl --state=failed | grep failed | cut -d \ -f 2 | tr '\n' ' '`"
63 fi
64 }
65
66 config=("default" "`uname -s`")
67
68 case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in
69 (*.debian.org)
70 export EMAIL=christoph@debian.org
71 config=($config debian)
72 ;;
73 (faui49*.uni-erlangen.de)
74 export EMAIL=Christoph.Egger@cs.fau.de
75 config=($config i4lab)
76 ;;
77 (faui0*.informatik.uni-erlangen.de|faui48*.informatik.uni-erlangen.de)
78 export EMAIL=siccegge@cs.fau.de
79 config=($config cip)
80 ;;
81 (*.siccegge.de)
82 export MAIL=christoph@christoph-egger.org
83 config=($config home)
84 ;;
85 esac
86
87 if [[ $UID == 0 && -f `which systemctl` ]]
88 then
89 PROMPT=$'%{$fg[red]>> $systemd_failed$reset_color%}\n'
90 else
91 PROMPT=""
92 fi
93
94 PROMPT+=$'%{$fg[yellow]%}%n@%{$fg[magenta]%}%m%{$reset_color%} %~ \n%{$fg[cyan]%}%T%{$reset_color%} %0(?,%{$fg[green]%},%{$fg[red]%}%s)%?%{$reset_color%} %# '
95
96 RPROMPT='${vcs_info_msg_0_}'
97
98 export DEBEMAIL='christoph@debian.org'
99 export DEBFULLNAME='Christoph Egger'
100 export DEB_BUILD_OPTIONS="parallel=$(getconf _NPROCESSORS_ONLN)"
101
102
103 for ftype in aliases includes
104 do
105 for location in $config
106 do
107 if [ -f ~/.zsh/${ftype}/${location}.zsh ]
108 then
109 source ~/.zsh/${ftype}/${location}.zsh
110 fi
111 done
112 done
113
114
115
116 karma () {
117 gpg --fingerprint $1 >> ${HOME}/karma
118 printf '\n-----\n\n' >> ${HOME}/karma
119 }
120
121 gpgrefresh () {
122 gpg --refresh-keys 2>&1 | grep -v 'nicht geƤndert'
123 }
124
125 sponsor() {
126 pkgname=`echo $i | rcut -d '/' -f 1 | cut -d '_' -f 1`
127 apt-get --download-only -t unstable $pkgname
128 dget $i
129 }
130
131 path=(${HOME}/bin $path)
132 fpath=(${HOME}/.zsh/functions/$CONFIG ${HOME}/.zsh/functions/default $fpath)
133
134 export PATH
135 export FPATH
136
137 alias wb="ssh -t buildd.debian.org wb"