-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
167 lines (139 loc) · 4.36 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
# shell
## For tramp: don't lag like crazy when I open a shell remotely
if [[ $TERM == "dumb" ]]
then
unsetopt zle
unsetopt prompt_cr
unsetopt prompt_subst
unfunction precmd
unfunction preexec
PS1='$ '
source ~/.zshenv
fi
## Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='emacs'
fi
# prezto
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
## Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"
## Uncomment the following line to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
## Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# set prompt
autoload -Uz promptinit
promptinit
## Get rid of extra prompt text
DEFAULT_USER="pakelley"
# aliases
## ls's
alias ll='exa -alFh --git'
alias la='exa -a'
alias l='exa -F'
alias lls='exa -alFhs size'
alias llr='exa -alFhrs size'
alias llS='exa -alFhs date'
alias llR='exa -alFhrs date'
## ..'s
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
## zsh config
alias zshconfig="nvim ~/.zshrc"
alias "docker-run"="docker run --rm -it"
alias mkubectl="kubectl --context=minikube"
alias open-cloud-sql="cat ~/Downloads/dev_env.txt | grep CLOUDSQL_PG_PASSWORD | awk '{ split(\$1,x,\"=\"); print x[2] }' | pbcopy; psql -h 127.0.0.1 -U proxyuser_bf -W -d postgres"
alias whats-my-version-again="cat conda.recipe/meta.yaml | grep 'version:' | awk '{ print \$2 }'"
# bnv
alias bnv="/opt/miniconda3/bin/bnv"
# Google Cloud SDK
## PATH
if [ -f '/Users/pkelley/Downloads/google-cloud-sdk/path.zsh.inc' ]; then source '/Users/pkelley/Downloads/google-cloud-sdk/path.zsh.inc'; fi
## command completion
if [ -f '/Users/pkelley/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then source '/Users/pkelley/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
# shell utils
## autosuggestions
ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(end-of-line)
ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS+=(forward-char emacs-forward-word)
## z
# source `brew --prefix`/Cellar/z/1.9/etc/profile.d/z.sh
## iterm
source $DOTFILES_DIR/config/shell/zsh/iterm2_shell_integration.zsh
## fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
##zsh syntax highlighting
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# antigen
source /usr/local/share/antigen/antigen.zsh
antigen bundle supercrabtree/k
antigen bundle wbingli/zsh-wakatime
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
antigen apply
hackon () {
# virtualenvwrapper_load
# workon "$@"
source activate "$@"
z "$@"
}
hackoff () {
source deactivate
}
hackout () {
if [[ -n "$@" ]]; then
env_name="$@"
elif [[ -n "$CONDA_DEFAULT_ENV" ]]; then
env_name="$CONDA_DEFAULT_ENV"
fi
if [[ -n $env_name ]]; then
env_file="$DOTCONF_DIR/python/common-env.yml"
echo "Updating environment $env_name using environment file $env_file"
conda env update -f "$env_file" -n "$env_name"
else
echo "No conda environment activated or specified, no changes will be made"
fi
}
checkport() {
port_num="$@"
lsof -nP -i4TCP:$port_num
}
find-emacs-pythons() {
psgrep python | grep anaconda-mode
}
kill-emacs-pythons() {
for pid in `psgrep python | grep anaconda-mode | awk '{print $2}'`; do kill $pid; done
}
# vi mode
bindkey "^[" vi-cmd-mode
# # autocomplete
# source ~/.zsh_completions.d/binvoke_autocomplete.zsh.sh
# source ~/.zsh_completions.d/helm_autocomplete.zsh.sh
# # bombora
# for f in /keybase/team/bombora/profile-scripts/*; do $f; done
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# zoxide
eval "$(zoxide init zsh)"
# vpn
alias build-vpn="make -C $HOME/Downloads/dev-env build-dev-env"
alias start-vpn="make -C $HOME/Downloads/dev-env run-dev-env"
alias connect-vpn="make -C $HOME/Downloads/dev-env connect-vpn"
export PATH="$HOME/.poetry/bin:$PATH"