-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
176 lines (139 loc) · 4.62 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Path to your oh-my-zsh configuration.
ZSH=$HOME/dotfiles/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="hutch"
# Bitte nicht piepen. Das nervt:
unsetopt BEEP
# Example aliases
alias reload="source ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Zeilen mit einem # am Anfang werden als Kommentare interpretiert:
INTERACTIVE_COMMENTS="true"
setopt interactivecomments
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git nyan django systemadmin gpg-agent pip)
if [[ $OSTYPE == "darwin"* ]]; then
plugins=("${plugins[@]}" brew)
elif [[ $OSTYPE == "linux-gnu" ]]; then
plugins=("${plugins[@]}" debian)
else
>&2 echo "Kein Mac oder Linux. Wo bin ich?"
fi
source $ZSH/oh-my-zsh.sh
function command_exists() {
command -v $1 > /dev/null 2>&1
}
# Pfade:
DEFAULTPATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
if [[ -d "$HOME/.gem/ruby/2.3.0/bin" ]]; then
RUBYBINPATH="$HOME/.gem/ruby/2.3.0/bin"
fi
if [[ -d "$HOME/.local/bin" ]]; then
HOMEBINPATH="$HOME/.local/bin"
fi
if [[ -d "/usr/local/opt/coreutils/libexec/gnubin" ]]; then
HOMEBREWGNUBINPATH="/usr/local/opt/coreutils/libexec/gnubin"
fi
export PATH="$HOMEBINPATH:$HOMEBREWGNUBINPATH:$DEFAULTPATH:$RUBYBINPATH"
MANPATH="$MANPATH:$HOME/.local/share/man"
export MANPATH
# Python stuff:
export PYTHONIOENCODING=UTF-8
# virtualenvwrapper stuff:
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
export VIRTUALENV_PYTHON=$VIRTUALENVWRAPPER_PYTHON
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/lemnos
if [[ -x $(which virtualenvwrapper.sh) ]]; then
source $(which virtualenvwrapper.sh)
else
>&2 echo "virtualenvwrapper.sh nicht vorhanden"
fi
# Lade meine dircolors, sofern vorhanden:
if [[ -f $HOME/.dircolors ]]; then
eval $(dircolors -b $HOME/.dircolors)
else
>&2 echo "$HOME/.dircolors nicht vorhanden"
fi
# Aliase und Funktionen:
alias ls="ls --color=auto"
alias la="ls -AF"
alias bc='bc -l'
if [[ -d "$HOME/Downloads/" ]]; then
alias mutt='cd "$HOME/Downloads" && mutt'
fi
if [[ -x $(which xdg-open) ]]; then
alias open='xdg-open'
fi
# generate new passwords:
if [[ -x $(which pwgen) ]]; then
alias neuespw='pwgen -B 20 1'
fi
if [[ -x $(which t) ]]; then
alias tt='t d -s "30 days ago"'
fi
# um php in der Shell benutzen zu können:
if [[ -f /etc/profile.d/phpversion.sh ]]; then
source /etc/profile.d/phpversion.sh
fi
if [[ -f "$HOME/bin/composer.phar" ]]; then
alias composer='php ~/bin/composer.phar'
fi
if [[ -x $(which timetrap) ]]; then
alias tt='timetrap d -s "30 days ago"'
fi
export EDITOR=vim
alias e=$EDITOR
alias se="sudoedit"
export PAGER="less"
export GOPATH="$HOME/lemnos/go"
if [[ "$COLORTERM" == "gnome-terminal" ]]; then
export TERM="xterm-256color"
fi
# connect via xfreerdp to uniapps.uni-rostock.de
if [[ -x $(which xfreerdp) ]]; then
function uniapps () {
xfreerdp --sec tls -d uni-rostock.de -u "$1" -x b -g 95% uniapps.uni-rostock.de
}
fi
function learn_spam () {
ssh uber 'for f in ~/users/martin/.Spam/cur/*; do echo -n "$(spamc -L spam -U ~/tmp/spamd.sock < $f) "; grep -h ^Subject: $f; done'
}
function learn_ham () {
ssh uber 'for f in ~/users/martin/.Archive/cur/*; do echo -n "$(spamc -L ham -U ~/tmp/spamd.sock < $f) "; grep -h ^Subject: $f; done'
}
function mount_joerdis() {
TARGET="$HOME/joerdis"
if ! mountpoint -q "$TARGET"; then
sshfs md@joerdis:/home/md $TARGET
fi
}
if command_exists iconv ; then
function latin1_to_utf8 () {
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
iconv -f latin1 -t utf8 "$1" > "$filename"_utf8."$extension"
}
function utf8_to_latin1 () {
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
iconv -f utf8 -t latin1 "$1" > "$filename"_latin1."$extension"
}
fi