-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
169 lines (137 loc) · 3.86 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
168
169
fpath=($HOME/.zsh-completions/src $fpath)
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="ys"
#ZSH_THEME="bira"
ZSH_THEME="eastwood"
#ZSH_THEME="macovsky-ruby"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# vim
# https://twitter.com/a_matsuda/status/899415149341065216
function v() {nvim ${${=*/:/ +}/:*}}
# git
alias gb='git branch'
alias gch='git checkout'
alias gs='git status'
alias gc='git commit -m'
alias gco='git commit'
alias gca='git commit --amend'
alias gl='git log'
alias gf='git fetch'
alias gm='git merge'
alias gr='git rebase'
alias gd='git diff'
alias gf='git fetch'
alias gm='git merge'
alias gdc='git diff --cached'
alias gaa='git add --all'
alias gap='git add -p'
alias gp='git push'
alias gdb="git branch --merged | grep -vE '^\*|master$|release$|develop$' | xargs -I % git branch -d %"
clone() {
local yes_cd=true
while getopts "d:" OPTION
do
case $OPTION in
d)
local yes_cd=false
shift
;;
esac
done
if [[ -z $2 ]]; then
local repo_name=$1
while [ "${repo_name%%/*}" != "$repo_name" ]; do
repo_name=${repo_name#*/}
done
repo_name=${repo_name%.*}
git clone $1
if $yes_cd; then; cd $repo_name; fi
else
if [[ $# -eq 3 ]]; then
git clone [email protected]:$1/$2.git $3
if $yes_cd; then; cd $3; fi
else
git clone [email protected]:$1/$2.git
if $yes_cd; then; cd $2; fi
fi
fi
}
# basic
alias ll='ls -la'
alias rm='rm -i'
alias mkdir='mkdir -p'
# bundler
alias b='bundle'
alias be='bundle exec'
alias bu='bundle update'
# rails
alias r='rails'
alias rrp='bundle exec rake routes | peco'
# project
alias life='cd ~/dev/github/proofoflife'
alias bmg='cd ~/dev/github/bmg'
alias kulku='cd ~/dev/github/kulku'
alias blog='cd ~/dev/github/blog'
alias pplog='cd ~/dev/github/pplog'
alias esa='cd ~/dev/github/esa'
alias doit='cd ~/dev/github/doit'
# middleman
alias bem='bundle exec middleman'
# brew install colordiff
alias diff='colordiff'
alias less='less -R'
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
#plugins=(git pow bundler rbenv bunder gem pow redis-cli)
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
export PATH=/usr/local/sbin:$HOME/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
# Homebrew
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
### Added by Nodebrew
if [ -d ${HOME}/.nodebrew ] ; then
export PATH=$HOME/.nodebrew/current/bin:$PATH
fi
# Added by Rails binstubs
export PATH="./bin:$PATH"
# v8
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
if [ -d ${HOME}/.plenv ] ; then
export PATH="$HOME/.plenv/bin:$PATH"
eval "$(plenv init -)"
fi
# added by travis gem
if [ -d ${HOME}/.travis ] ; then
source ~/.travis/travis.sh
fi
if [ -e ${HOME}/.zshrc_ext ] ; then
source ~/.zshrc_ext
fi
export EDITOR=vim
eval "$(direnv hook zsh)"
# java
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
# rbenv
export PATH=$HOME/.rbenv/shims:$PATH
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm