-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases.sh
116 lines (106 loc) · 3.2 KB
/
aliases.sh
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
# bashでもzshでも動くように書く
# --------------------------------------------------------------------
# Utilities
# --------------------------------------------------------------------
alias la='ls -ahl'
alias ll='ls -hl'
alias jis2sjis='nkf -Js'
alias jis2euc='nkf -Je'
alias jis2utf8='nkf -Jw'
alias sjis2jis='nkf -Sj'
alias sjis2euc='nkf -Se'
alias sjis2utf8='nkf -Sw'
alias euc2jis='nkf -Ej'
alias euc2sjis='nkf -Es'
alias euc2utf8='nkf -Ew'
alias utf82jis='nkf -Wj'
alias utf82sjis='nkf -Ws'
alias utf82euc='nkf -We'
alias today='days_since 0'
alias yesterday='days_since -1'
alias tomorrow='days_since 1'
alias reload="exec $SHELL -l"
function mkcd(){
mkdir -p $1
cd $1
pwd
}
function rfind(){
find . -name $1
}
function d(){
cd ~/develop/$1
pwd
}
alias zip="zip -x '*.DS_Store'"
alias ql='qlmanage -p "$@" >& /dev/null'
alias hg='history 0 | grep'
# --------------------------------------------------------------------
# Apps
# --------------------------------------------------------------------
alias mine='open -na "RubyMine.app" --args'
alias idea='open -na "IntelliJ IDEA Ultimate.app" --args'
# --------------------------------------------------------------------
# Ruby
# --------------------------------------------------------------------
alias bi='bundle install'
alias bu='bundle update'
alias bx='bundle exec'
alias r='bin/rails'
alias rc='bin/rails console'
alias rs='bin/rails server'
alias mm='bundle exec middleman'
alias mmb='bundle exec middleman build'
alias mms='bundle exec middleman server'
# --------------------------------------------------------------------
# Docker
# --------------------------------------------------------------------
alias dcu='docker-compose up'
alias dcud='docker-compose up -d'
alias dp='docker ps'
alias dk='docker kill'
alias dka='docker kill $(docker ps -q)'
# --------------------------------------------------------------------
# Git
# --------------------------------------------------------------------
alias ga='git add'
alias gb='git branch'
alias gbg='git branch | grep -i'
alias gci='git commit'
alias gcl='git clone'
alias gco='git checkout'
alias gcom='git checkout `gdb`'
# git checkout by branch
gcobb() {
git checkout `gbg "$1" | head -n 1 | sed "s@^ @@"`
}
alias gd='git diff'
# git default branch
alias gdb='git symbolic-ref refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@"'
alias gdc='git diff --cached'
alias gf='git fetch'
alias gi='git init'
alias gl='git log'
alias gm='git merge'
alias gpl='git pull'
alias gps='git push'
alias gpsu='git push-u'
alias grm='git rebase `gdb`'
alias gr='git reset'
alias grs='git reset --soft'
alias grh='git reset --hard'
alias grao='git remote add origin'
alias grso='git remote set-url origin'
alias gs='git status'
alias gsl='git stash list'
alias gsp='git stash pop'
alias gss='git stash save'
# --------------------------------------------------------------------
# Ansible
# --------------------------------------------------------------------
alias ap='ansible-playbook'
alias ad='ansible-doc'
# --------------------------------------------------------------------
# CLI Tools
# --------------------------------------------------------------------
export PATH=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)/bin:$PATH