-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
116 lines (89 loc) · 2.75 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
#################
### oh-my-zsh ###
#################
# Path to your oh-my-zsh installation.
export ZSH="/Users/xiao/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# iTerm background set to 202020, cyan to 60c2ff
ZSH_THEME="robbyrussell"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
plugins=(
git
)
# load oh-my-zsh
source $ZSH/oh-my-zsh.sh
###################
### zsh plugins ###
###################
# zsh syntax highlighting
if [ -f "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]; then
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# zsh auto suggestion
if [ -f "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]; then
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
#####################
### XXenv configs ###
#####################
# pyenv configs
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
if which pyenv-virtualenv-init > /dev/null; then
eval "$(pyenv virtualenv-init -)";
fi
# Goenv configs
export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
################
### Homebrew ###
################
# Use homebrew installation than system installation such as git
export PATH="/usr/local/bin:${PATH}"
## fix https://github.com/pyenv/pyenv/issues/106
alias brew='env PATH=${PATH//$(pyenv root)\/shims:/} brew'
###########
### Git ###
###########
# Git config variables
_I_=' '
HASH="%C(green)%h%C(reset)"
AGE="%C(yellow)%ar%C(reset)"
AUTHOR="%C(bold blue)%an%C(reset)"
REFS="%C(bold red)%d%C(reset)"
COMMENT="%s"
FORMAT="$HASH$_I_$AGE$_I_$AUTHOR$_I_$REFS $COMMENT"
###############
### aliases ###
###############
# ls aliases
alias ll='ls -al'
# Git aliases
alias ga='git add'
alias gc='git commit'
alias gd='git diff'
alias gl='git log --oneline --graph --decorate --pretty="tformat:${FORMAT}"'
alias gla='git log --oneline --graph --decorate --all --pretty="tformat:${FORMAT}"'
alias gs='git status'
# Ruby aliases
alias be='bundle exec'
# Proxy aliases
alias p='source $HOME/.xiao/proxy on'
alias np='source $HOME/.xiao/proxy off'
##################
### GCloud SDK ###
##################
# The next line updates PATH for the Google Cloud SDK.
if [ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/google-cloud-sdk/path.zsh.inc"; fi
# The next line enables shell command completion for gcloud.
if [ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/google-cloud-sdk/completion.zsh.inc"; fi
######################
### User specified ###
######################
# export GOPRIVATE=