-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile
83 lines (73 loc) · 2.29 KB
/
profile
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
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
pathadd "$HOME/bin"
fi
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1
# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
# paths
pathadd /Users/shibo/scripts
export GOPATH=/Users/shibo/Code/go
# export GO111MODULE=on
pathadd "$GOPATH/bin"
export PY=/Users/shibo/Code/python
export JS=/Users/shibo/Code/js
export DEV=/Users/shibo/Code/dev
pathadd "/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# aliases
alias c='clear'
alias gpp='git pull && git push'
alias gprp='git pull --rebase && git push'
alias gp='git push'
alias gpl='git pull'
alias gpr='git pull --rebase'
alias gpom='git pull origin master'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias glp='gl -p'
alias gln='gl --name-only'
alias gs='git status'
alias gb='git branch'
alias gc='git checkout'
alias gcb='git checkout -b'
alias gcm='git commit -m '
alias gca='git commit --amend'
alias gd='git diff'
alias gds='git diff --staged'
alias gm='git merge'
alias gmf='git merge --no-ff'
alias gms='git merge --squash'
alias ga='git add'
alias gr='git reset'
alias grh='git reset --hard'
alias gst='git stash'
alias gsta='git stash apply'
alias gorigin='git remote show origin'
alias memcached-restart="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist;launchctl load ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist"
alias agfzf='ag --nobreak --nonumbers --noheading . | fzf'
# init pyenv
eval "$(pyenv init -)"
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# init nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
pathadd "$(npm bin -g)"
export GPG_TTY=$(tty)
# git aware prompt
export PS1="\u@\h \W \[\$txtcyn\]\$git_branch\[\$txtred\]\$git_dirty\[\$txtrst\]\$ "
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"