forked from mislav/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bash_aliases
executable file
·144 lines (124 loc) · 3.31 KB
/
bash_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
# Some useful aliases
# vi:filetype=sh:
#alias aliases='vim ~/.bash_aliases && source ~/.bash_aliases'
# Function which adds an alias to the current shell and to
# the ~/.bash_aliases file.
add-alias ()
{
local name=$1 value="$2"
echo "alias $name='$value'" >> ~/.bash_aliases
eval "alias $name='$value'"
alias $name
}
#######
# git #
#######
alias gl='git pull --rebase'
alias gp='git push'
alias gd='git diff'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch -v'
function gco {
if [ -z "$1" ]; then
git checkout master
else
git checkout $1
fi
}
function st {
if [ -d ".svn" ]; then
svn status
else
git status
fi
}
#shorthands for mislav's excellent each-git:
alias gpa='echo "git pull" | each-git'
alias gfa='echo "git fetch" | each-git -d'
#######
# SVN #
#######
alias sup='svn up' # trust me 3 chars makes a different
# alias sstu='svn st -u' # remote repository changes
# alias scom='svn commit' # commit
alias svnclear='find . -name .svn -print0 | xargs -0 rm -rf' # removes all .svn folders from directory recursively
alias svnaddall='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add' # adds all unadded files
########
# RUBY #
########
# use readline, completion and require rubygems by default for irb
alias irb='irb --simple-prompt -r irb/completion -rubygems'
# really awesome function, use: cdgem <gem name>, cd's into your gems directory
# and opens gem that best matches the gem name provided
#function cdgem {
# cd `gem env gemdir`/gems
# cd `ls | grep $1 | sort | tail -1`
#}
#function gemdoc {
# GEMDIR=`gem env gemdir`/doc
# open $GEMDIR/`ls $GEMDIR | grep $1 | sort | tail -1`/rdoc/index.html
#}
#function mategem {
# GEMDIR=`gem env gemdir`/gems
# mate $GEMDIR/`ls $GEMDIR | grep $1 | sort | tail -1`
#}
#alias qri='qri -w 98'
#alias fri='fri -w 98'
#########
# RAILS #
#########
########
# misc #
########
#alias texclean='rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky'
#alias clean='echo -n "Really clean this directory?";
# read yorn;
# if test "$yorn" = "y"; then
# rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp core a.out;
# echo "Cleaned.";
# else
# echo "Not cleaned.";
# fi'
alias h='history'
alias j="jobs -l"
alias l="ls -lah"
alias ll="ls -l"
alias la='ls -A'
# alias pu="pushd"
# alias po="popd"
alias m="mate ."
#alias g="git"
#alias oc="cd ~/Projects/oc"
#alias oci="cd ~/Projects/oci"
#alias lq="cd ~/Projects/livecliq"
#alias pg="cd ~/Sources/playground"
#alias dots="cd ~/dotfiles"
#alias in="cd ~/Install"
alias aliases="mate ~/.bash_aliases"
#alias s="cd ~/Sources"
#alias d="cd ~/Designs"
#alias p="cd ~/Projects"
#alias gx="gitx"
#alias gempath="cd /Library/Ruby/Gems/1.8/gems"
#alias good="git bisect good"
#alias bad="git bisect bad"
alias gsu="git submodule update --init"
########
# my aliases
#######
alias dev="cd ~/development"
alias repos='dev;cd repos'
alias xc='open *.xcodeproj'
alias xcw='open *.xcworkspace'
alias rnd='dev;cd random'
alias pro='dev;cd projects'
alias dot='repos;cd dotfiles'
alias work='dev;cd work'
# find broken symlinks, for dotfiles
# thanks to
# http://github.com/markcatley/dotfiles/commit/ee1b7013135f9c3813b43b9cd107b9d9294c7d49
#
# use with | grep dotfiles ;)
alias broken_links='find . -type l | (while read FN ; do test -e "$FN" || ls -ld "$FN"; done)'
alias matediff='svn diff | mate'