-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
49 lines (37 loc) · 1.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
# init rbenv
eval "$(rbenv init -)"
PATH=./bin:$PATH
PATH=~/.bin:$PATH
PATH=~/go/bin:$PATH
PATH=~$HOME/.cargo/bin:$PATH
# don't cache the bin files
set +h
setopt prompt_subst
# use vim as an editor
export EDITOR=vim
export BUNDLER_EDITOR=code
# load custom env vars
source "$HOME/.env.local"
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# function precmd() {
# current_git_branch=`git rev-parse --abbrev-ref HEAD`
#}
PS1='%F{green}%2~%F{yellow}$(parse_git_branch) %F{grey}$%F{grey} '
# kubes env helpers
switch_env() {
eval "$(cb env "$1")" && echo $1 > ~/.clearbit-env
}
dev() { switch_env 'us-west-1.dev-2' && echo "Switched to development"; }
stag() { switch_env 'us-west-1.staging-2' && echo "Switched to staging"; }
prod() { switch_env 'us-west-1.prod' && echo "Swiched to production";}
alias robo="robo --config ~/code/clearbit/robofiles/robo.yml"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion