4 if ls --help 2>/dev
/null |
grep -q GNU
; then
5 alias ls='command ls -AF --color=auto'
6 elif isdarwin || isfreebsd
; then
7 alias ls='command ls -AF -G'
10 alias lsbig
='command ls -flh *(.OL[1,10])' # display the biggest files
11 alias lssmall
='command ls -Srl *(.oL[1,10])' # display the smallest files
12 alias lsnew
='command ls -rl *(D.om[1,10])' # display the newest files
13 alias lsold
='command ls -rtlh *(D.om[-11,-1])' # display the oldest files
15 alias mv='command mv -i'
16 alias mmv
='noglob mmv'
17 alias cp='command cp -i'
18 alias wget
='noglob wget'
19 alias cgrep
='grep --color'
20 alias git
='LANG=C git'
21 alias rot13
='tr a-zA-Z n-za-mN-ZA-M'
23 alias psql
='LANG=C LD_PRELOAD=/lib/libreadline.so.5 psql'
25 alias logout='noglob logout'
27 # want to trace a shell function? ztrace $FUNCTIONNAME and there it goes.
28 alias ztrace
='typeset -f -t'
29 alias zuntrace
='typeset -f +t'
34 # convenient abbreviations
43 alias cd...
='cd ../..'
44 alias cd....
='cd ../../..'
45 alias cd.....
='cd ../../../..'
47 for index
({1.
.9}) alias "$index"="cd -${index}"; unset index
50 alias cpan
='perl -MCPAN -e shell'
54 alias man
='LANG=C nocorrect noglob man'
55 alias mysql
='nocorrect mysql'
56 alias mkdir
='nocorrect mkdir'
57 alias mv='nocorrect mv'
59 #global aliases. Handle with care!
63 alias -g CD
='| colordiff | less -R'
65 if [ -x /usr
/bin
/recode ]; then
66 alias unix2dos
='recode lat1..ibmpc'
67 alias dos2unix
='recode ibmpc..lat1'
70 # used when you press M-? on a command line
71 alias which-command
='whence -a'
73 # zsh function tracing
74 alias ztrace
='typeset -f -t'
75 alias zuntrace
='typeset -f +t'
77 alias gitolite_spi
='ssh git@git.spi-inc.org'
79 # Make popd changes permanent without having to wait for logout
80 if zstyle
-T ':ganneff:config' dirpersiststore
&& is434
; then
81 alias popd="popd;dirpersiststore"
87 alias gst
='git status'
89 alias gup
='git pull --rebase'
92 alias gc
='git commit -v'
93 alias gca
='git commit -v -a'
94 alias gco
='git checkout'
95 alias gcm
='git checkout master'
97 alias grv
='git remote -v'
98 alias grmv
='git remote rename'
99 alias grrm
='git remote remove'
100 alias grset
='git remote set-url'
101 alias grup
='git remote update'
102 alias gb
='git branch'
103 alias gba
='git branch -a'
104 alias gcount
='git shortlog -sn'
105 alias gcl
='git config --list'
106 alias gcp
='git cherry-pick'
107 alias glg
='git log --stat --max-count=5'
108 alias glgg
='git log --graph --max-count=5'
109 alias glgga
='git log --graph --decorate --all'
110 alias gss
='git status -s'
113 alias grh
='git reset HEAD'
114 alias grhh
='git reset HEAD --hard'
115 alias gwc
='git whatchanged -p --abbrev-commit --pretty=medium'
116 alias gf
='git ls-files | grep'
117 alias gpoat
='git push origin --all && git push origin --tags'
120 # Will cd into the top of the current repository
122 alias grt
='cd $(git rev-parse --show-toplevel || echo ".")'
124 alias gsr
='git svn rebase'
125 alias gsd
='git svn dcommit'
127 # Will return the current branch name
128 # Usage example: git pull origin $(current_branch)
131 ref
=$
(git symbolic-ref HEAD
2> /dev
/null
) || \
132 ref
=$
(git rev-parse
--short HEAD
2> /dev
/null
) ||
return
133 echo ${ref#refs/heads/}
136 current_repository
() {
137 ref
=$
(git symbolic-ref HEAD
2> /dev
/null
) || \
138 ref
=$
(git rev-parse
--short HEAD
2> /dev
/null
) ||
return
139 echo $
(git remote
-v | cut
-d':' -f 2)
142 # these aliases take advantage of the previous function
143 alias ggpull
='git pull origin $(current_branch)'
144 alias ggpush
='git push origin $(current_branch)'
145 alias ggpnp
='git pull origin $(current_branch) && git push origin $(current_branch)'