-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
57 lines (42 loc) · 1.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
export ZSH=~/.zsh
# Source git zshrc prompt style
source ~/dotfiles/zsh/lib/zsh-git-prompt/zshrc.sh
# Load all of the config files in ~/oh-my-zsh that end in .zsh
for config_file ($ZSH/lib/*.zsh) source $config_file
# Load and run compinit
autoload -U compinit
compinit -i
# this is a fix for vi in OS X
#alias vim="stty stop '' -ixoff; vim"
# this adds an extra line break before every new prompt
precmd() { print "" }
export TERM='screen-256color'
if test "$TERM" != linux; then
# show current command, directory, and user in terminal title
precmd() { print -Pn "\e]2;$0 (%~) %n@%m\a" 2>/dev/null }
preexec() { print -Pn "\e]2;$1 (%~) %n@%m\a" 2>/dev/null }
fi
# generate random passwd (32 chars)
genpasswd() {
openssl rand -base64 32
}
genpassphrase() {
# echo $(grep "^[^']\{3,5\}$" /usr/share/dict/words|shuf -n5)
echo $(grep "^[^']\{1,10\}$" ~/dotfiles/all.dic|shuf -n4)
}
dpkgclean() {
dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge
}
# avoid most common annoying correction:
alias sudo='nocorrect sudo'
# SSH/GPG Agent
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
# golang stuff
export GOPATH="$HOME/work/go" # add GOPATH (golang)
export GOBIN="$GOPATH/bin" # add GOBIN (binary)
export PATH="$PATH:$GOPATH" # add GOPATH to PATH
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/tmp/google-cloud-sdk/path.zsh.inc' ]; then . '/tmp/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/tmp/google-cloud-sdk/completion.zsh.inc' ]; then . '/tmp/google-cloud-sdk/completion.zsh.inc'; fi