forked from campuscode/cc_dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
193 lines (166 loc) · 4.37 KB
/
aliases
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Based on Skwp's aliases
# https://raw.githubusercontent.com/skwp/dotfiles/997d36bef991652dd436c076e57d8f00c49f4994/zsh/aliases.zsh
ccdf=$HOME/.cc_dotfiles
os_family=`echo $(uname) | tr '[:upper:]' '[:lower:]'`
# global
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
# PS
alias psa="ps aux"
alias psg="ps aux | grep "
alias psr='ps aux | grep ruby'
# Moving around
alias cdb='cd -'
alias cls='clear;ls'
alias clr='clear'
# Show human friendly numbers and colors
alias df='df -h'
alias du='du -h -d 2'
alias ll='ls -lGh'
alias la='ll -a'
alias ls='ls -Gh'
# show me files matching "ls grep"
alias lsg='ll | grep'
alias lag='la | grep'
# Alias Editing
alias ae='vim $ccdf/aliases' #alias edit
alias ar='source $ccdf/aliases' #alias reload
# Local
alias ael="vim $HOME/.aliases.local"
alias arl="source $HOME/.aliases.local"
# Search Alias
alias aliass='alias | grep'
# vim using
mvim --version > /dev/null 2>&1
MACVIM_INSTALLED=$?
if [ $MACVIM_INSTALLED -eq 0 ]; then
alias vim="mvim -v"
fi
# mimic vim functions
alias :q='exit'
# vimrc editing
alias ve='vim $HOME/.vimrc'
# zsh profile editing
alias ze='vim $HOME/.zshrc'
alias zr='source $HOME/.zshrc'
alias zrl='source $HOME/.zshrc.local'
# history
alias hfull='history 1 -1'
# Git Aliases
alias gs='git status'
alias gst='git status'
alias gsts='git stash'
alias gsth='git stash'
alias gsp='git stash pop'
alias gsa='git stash apply'
alias gsl='git stash list'
alias gsh='git show'
alias gshw='git show'
alias gshow='git show'
alias gi='vim .gitignore'
alias gc='git c'
alias gcm='git cm'
alias gca='git ca'
alias gcam='git cam'
alias gco='git co'
alias gcp='git cp'
alias ga='git add -A'
alias guns='git unstage'
alias gunc='git uncommit'
alias gm='git merge'
alias gms='git merge --squash'
alias gam='git amend'
alias grv='git remote -v'
alias grx='git remote rm'
alias grad='git remote add'
alias gr='git rebase'
alias gra='git rebase --abort'
alias grc='git rebase --continue'
alias gri='git rebase --interactive'
alias gl='git l'
alias glg='git l'
alias glog='git l'
alias co='git co'
alias gf='git fetch'
alias gfch='git fetch'
alias gd='git diff'
alias gb='git b'
alias gbx='git branch --delete'
alias gbX='git branch -D'
alias gbd='git b -D -w'
alias gdc='git diff --cached -w'
alias gpl='git pull'
alias gplr='git pull --rebase'
alias gp='git push'
alias gpX='git push --delete'
#push current branch
alias gpsh='git push -u origin `git rev-parse --abbrev-ref HEAD`'
alias gpom="git push origin master"
alias gnb='git nb' # new branch aka checkout -b
alias grs='git reset'
alias grsh='git reset --hard'
alias gcln='git clean'
alias gclndf='git clean -df'
alias gclndfx='git clean -dfx'
alias gt='git t'
alias gtn='git t -n'
alias gbg='git bisect good'
alias gbb='git bisect bad'
alias gcl="git clone"
# docker-compose
alias dc="docker-compose"
alias dcr="dc run --rm --service-ports"
alias dcR="dc run --rm" # no service ports
alias dcrwb="dcr web bash"
alias dcb="dc build"
alias dcps="dc ps"
alias dcS="dc stop"
alias dcup="dc up"
# Common shell functions
alias less='less -r'
alias tf='tail -f'
alias l='less'
alias lh='ls -alt | head' # see the last modified files
alias cl='clear'
# Zippin
alias gz='tar -zcvf'
alias bz2="tar -jcvf"
alias xgz='tar -zxvf'
alias xbz2="tar -jxvf"
# Ruby
alias tfdl='tail -f log/development.log'
alias tftl='tail -f log/test.log'
alias ka9='killall -9'
alias k9='kill -9'
# Gem install
alias gi='gem install --no-ri --no-rdoc'
alias rdm='rake db:migrate'
alias rdr='rake db:rollback'
alias rdmr='rake db:migrate:redo'
alias rrs='rake routes'
# Rspec
alias rs='rspec spec'
alias brspec='bundle exec rspec'
# Rails
alias rc='rails c'
alias rsb='rails s -b 0.0.0.0'
alias brails='bundle exec rails'
if [[ $os_family == 'darwin' ]]
then
# Finder
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
# Homebrew
alias brewu='brew update && brew upgrade && brew cleanup && brew prune && brew doctor'
alias mykey="cat $HOME/.ssh/id_rsa.pub | pbcopy"
fi
if [[ $os_family == 'linux' ]]
then
alias ll='ls -lh --color=auto'
alias ls='ls --color=auto'
alias mykey="cat $HOME/.ssh/id_rsa.pub | xclip -i -selection clipboard"
fi
# your aliases
[[ -f $HOME/.aliases.local ]] && source $HOME/.aliases.local
# vim: ft=zsh