-
Notifications
You must be signed in to change notification settings - Fork 1
/
aliases
155 lines (129 loc) · 4.04 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
# Reload zshrc
alias sss='source ~/.zshrc'
# Forget Me Not Task Manager
alias tl='fmn list'
alias ta='fmn add'
alias td='fmn done'
alias t='tig'
# Navigation
alias ~='cd ~'
# git
alias g='git'
alias gb='git branch'
alias gs='nocorrect git status --short'
alias ga='nocorrect git add'
alias gaa='nocorrect git add --all'
alias gc='nocorrect git commit'
alias gcm='nocorrect git commit -m'
alias gcn='git commit --amend --no-edit'
alias gp='nocorrect git push'
alias gl='nocorrect git pull'
alias gh='git checkout'
alias ghp='git checkout -p'
alias gh.='git checkout .'
alias gh-='git checkout -'
alias gnb='git checkout -b'
alias gd='git diff'
alias gdc='git diff --cached'
alias gm='git merge'
alias gr='git rebase'
alias gf='git fetch'
alias gfr='git fetch && git rebase origin/master'
alias gt='git tag'
# merge by always making a new commit (--no-ff) and open editor for the commit message (-e)
alias gmm='git merge --no-ff -e'
alias gsp='git submodule foreach git pull'
alias gsu='git submodule update'
alias gcp='git cherry-pick'
alias glgr='git log --oneline --reverse'
alias grbc='git rebase --continue'
# See https://coderwall.com/p/euwpig
alias glg="git log \
--graph \
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %an%Creset' \
--abbrev-commit"
# see above + only show commits made in the the current branch
alias glgf='glg --first-parent'
# Hub is a CLI client for the GitHub APIs
# https://github.com/github/hub
alias gpr='hub pull-request'
alias cpr='hub pr checkout' # usage `cpr <PR id>`
# Stay safe when git commit -a
safe_command() {
message=$1
shift 1
echo "$message"; echo -n "\e[0;33;49mAre you sure? (y/n) \e[0m"; read ANSWER; if [ $ANSWER = y ]; then $*; fi;
}
message='\e[0;33;49mYou are about to perform a git commit all.\e[0m'
# no correct doesn't work here... why?
gca_cmd='git commit -a'
gcam_cmd='git commit -a -m'
alias gca="safe_command '$message' $gca_cmd"
alias gcam="safe_command '$message' $gcam_cmd"
alias gri="git rebase --interactive"
alias gir=gri
alias gpt="git push; git push --tags"
alias gap="git add -p"
alias gchp="git checkout -p"
# List the 10 most recent branches
alias grb="git branch --sort=committerdate | tail -10 | more"
# Git-Flow aliases
# https://github.com/nvie/gitflow
alias gfl='nocorrect git flow'
alias gff='nocorrect git flow feature'
alias gffs='nocorrect git flow feature start'
alias g3f='nocorrect git flow feature finish'
# iOS & OS X development
alias xco='open -a Xcode .'
alias xbo='open -a /Applications/Xcode-beta.app .'
alias aco='open -a AppCode .'
alias pii='nocorrect pod install'
alias pi='nocorrect pod install && xco'
alias bpi='bundle exec pod install && xco'
# Ruby gem to find unused Objective-C imports, and eventually delete them
# https://github.com/dblock/fui
alias fui='nocorrect fui'
# Note! this assumes you have xctool available in your path
# and the .xctoolargs in the current working directory
alias xt='xctool test'alias ..='cd ..'
# Ruby
alias r='ruby'
alias rr='rake'
alias bi='bundle install'
alias be='bundle exec'
alias br='bundle exec rake'
# npm
alias nmp='npm'
# Apps
alias chrome='open -a Google\ Chrome'
alias m='open -a MacDown'
# Markoff is a markdown previewer
# https://github.com/thoughtbot/Markoff
alias mp='open -a Markoff'
alias v='vim'
alias ao='open -a /Applications/Android\ Studio.app'
alias cask='brew cask'
# Utils
# (You can download the "Lee" voice from the Voice Utility app)
alias sey="say -v Oliver \"Joe, I've completed the task you gave me\""
# Carthage
# using tu because cu is already taken by a system command
alias tu='carthage update --no-build'
alias tub='carthage update --build'
# Fastlane
alias f='fastlane'
alias bf='bundle exec fastlane'
# Update any software installed via Homebrew
# fd = fresh drink
alias fd='brew update && brew upgrade'
alias pb='pbcopy'
# A cat with syntax highlighting and Git support
# https://github.com/sharkdp/bat
alias cat='bat'
alias md=mkdir
mkdir_and_cd() {
mkdir $1 && cd $1
}
alias mc=mkdir_and_cd
alias haed=head
alias myip="ifconfig | grep 'inet ' | grep --invert-match 127 | cut -d' ' -f2"