-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
135 lines (113 loc) · 4.18 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
# -*- mode: shell-script; -*-
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
UNAME=`uname`
case $UNAME in
Darwin*)
OS=OSX
;;
Linux*)
OS=Linux
;;
*)
OS=Linux
;;
esac
# Start the gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent /bye >/dev/null 2>&1
fi
# Set SSH to use gpg-agent
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK_OLD=$SSH_AUTH_SOCK
case $OS in
OSX)
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
;;
*)
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
;;
esac
fi
# Set GPG TTY
GPG_TTY=$(tty)
export GPG_TTY
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null
# Updates the GPG-Agent TTY before every command since SSH does not set it.
function _gpg-agent-update-tty {
gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null
}
autoload add-zsh-hook
add-zsh-hook preexec _gpg-agent-update-tty
[ -e "${HOME}/.zsh_aliases" ] && source "${HOME}/.zsh_aliases"
[ -e "${HOME}/.zshrc_local" ] && source "${HOME}/.zshrc_local"
zstyle ':antidote:bundle' use-friendly-names on
source "$HOME/.antidote/antidote.zsh"
source <(antidote init)
if [[ $OS -eq 'OSX' ]]; then
# see oh-my-zsh README for explanation of this setting for gnu ls and
# colors
zstyle ':omz:lib:theme-and-appearance' gnu-ls yes
fi
antidote bundle zsh-users/zsh-completions
antidote bundle belak/zsh-utils path:completion
antidote bundle ohmyzsh/ohmyzsh path:lib
antidote bundle ohmyzsh/ohmyzsh path:plugins/battery
if [[ $OS -eq 'Linux' && $DISPLAY ]]; then
antidote bundle ohmyzsh/ohmyzsh path:plugins/bgnotify
elif [[ $OS -eq 'OSX' ]]; then
if (( $+commands[terminal-notifier] )); then
# TODO reenable when
# https://github.com/julienXX/terminal-notifier/issues/223 is fixed
antidote bundle ohmyzsh/ohmyzsh path:plugins/bgnotify
else
echo 'terminal-notifier not installed, install with `brew install terminal-notifier`'
fi
fi
antidote bundle ohmyzsh/ohmyzsh path:plugins/bower
antidote bundle ohmyzsh/ohmyzsh path:plugins/brew
antidote bundle ohmyzsh/ohmyzsh path:plugins/bundler
antidote bundle ohmyzsh/ohmyzsh path:plugins/colorize
antidote bundle ohmyzsh/ohmyzsh path:plugins/command-not-found
antidote bundle ohmyzsh/ohmyzsh path:plugins/direnv
antidote bundle ohmyzsh/ohmyzsh path:plugins/docker/completions kind:fpath
antidote bundle ohmyzsh/ohmyzsh path:plugins/git
antidote bundle ohmyzsh/ohmyzsh path:plugins/heroku
antidote bundle ohmyzsh/ohmyzsh path:plugins/history
antidote bundle ohmyzsh/ohmyzsh path:plugins/lein kind:fpath
antidote bundle ohmyzsh/ohmyzsh path:plugins/mosh
antidote bundle ohmyzsh/ohmyzsh path:plugins/pip
antidote bundle ohmyzsh/ohmyzsh path:plugins/python
antidote bundle ohmyzsh/ohmyzsh path:plugins/rake
antidote bundle ohmyzsh/ohmyzsh path:plugins/rbenv
antidote bundle ohmyzsh/ohmyzsh path:plugins/redis-cli kind:fpath
antidote bundle ohmyzsh/ohmyzsh path:plugins/tmux
antidote bundle ohmyzsh/ohmyzsh path:plugins/virtualenv
antidote bundle Tarrasch/zsh-autoenv
antidote bundle zsh-users/zsh-syntax-highlighting
#antidote bundle lukechilds/zsh-nvm
antidote bundle nnao45/zsh-kubectl-completion
antidote bundle mattberther/zsh-pyenv
antidote bundle romkatv/powerlevel10k
export PYENV_ROOT=`pyenv root`
if (($+commands[dircolors])); then
eval `dircolors $HOME/.dircolors`
fi
function chpwd() {
ls
}
REPORTTIME=1
bgnotify_threshold=30
source <(switcher init zsh)
# optionally use alias `s` instead of `switch`
alias s=switch
# optionally use command completion
source <(switch completion zsh)
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh