]> git.siccegge.de Git - dotfiles/zsh.git/blob - zshrc
Add .gitignore
[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
60 config=("default" "`uname -s`")
61
62 case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in
63 (*.debian.org)
64 export EMAIL=christoph@debian.org
65 config=($config debian)
66 ;;
67 (faui49*.uni-erlangen.de)
68 export EMAIL=Christoph.Egger@cs.fau.de
69 config=($config i4lab)
70 ;;
71 (faui0*.informatik.uni-erlangen.de|faui48*.informatik.uni-erlangen.de)
72 export EMAIL=siccegge@cs.fau.de
73 config=($config cip)
74 ;;
75 (*.siccegge.de)
76 export MAIL=christoph@christoph-egger.org
77 config=($config home)
78 ;;
79 esac
80
81 PROMPT=$'%{$fg[yellow]%}%n@%{$fg[magenta]%}%m%{$reset_color%} %~ \n%{$fg[cyan]%}%T%{$reset_color%} %0(?,%{$fg[green]%},%{$fg[red]%}%s)%?%{$reset_color%} %# '
82 RPROMPT='${vcs_info_msg_0_}'
83
84 export DEBEMAIL='christoph@debian.org'
85 export DEBFULLNAME='Christoph Egger'
86 export DEB_BUILD_OPTIONS="parallel=$(getconf _NPROCESSORS_ONLN)"
87
88
89 for ftype in aliases includes
90 do
91 for location in $config
92 do
93 if [ -f ~/.zsh/${ftype}/${location}.zsh ]
94 then
95 source ~/.zsh/${ftype}/${location}.zsh
96 fi
97 done
98 done
99
100
101
102 karma () {
103 gpg --fingerprint $1 >> ${HOME}/karma
104 printf '\n-----\n\n' >> ${HOME}/karma
105 }
106
107 gpgrefresh () {
108 gpg --refresh-keys 2>&1 | grep -v 'nicht geƤndert'
109 }
110
111 sponsor() {
112 pkgname=`echo $i | rcut -d '/' -f 1 | cut -d '_' -f 1`
113 apt-get --download-only -t unstable $pkgname
114 dget $i
115 }
116
117 path=(${HOME}/bin $path)
118 fpath=(${HOME}/.zsh/functions/$CONFIG ${HOME}/.zsh/functions/default $fpath)
119
120 export PATH
121 export FPATH
122
123 alias wb="ssh -t buildd.debian.org wb"