forked from mackwic/aliases.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.sh
72 lines (56 loc) · 1.65 KB
/
git.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
# Aliases related to git stuff
alias -g commti='commit'
alias -g gti='git'
alias g='git'
alias -g gc='git commit'
alias -g gca='git commit -a'
alias -g gs='git status -sb'
alias -g gps='git push'
alias -g gpl='git pull'
alias -g gsss='git stash'
alias -g gspp='git stash pop'
alias -g gsll='git stash list'
alias -g gd='git diff --color --color-words'
alias -g gdc='gd --cached'
alias -g gck='git checkout'
alias -g gsum='git summary'
alias -g gll='git log --color --no-merges --graph --pretty=format:"%C(auto)%h %C(auto)%d%Creset %C(auto)%s %C(red)%m%m %C(cyan)%an" --color --graph'
alias -g gl='git --no-pager log -30 --color --no-merges --graph --pretty=format:"%C(auto)%h %C(auto)%d%Creset %C(auto)%s %C(red)%m%m %C(cyan)%an" --color --graph'
alias -g grp='git \grep --break --heading --color -B 1 -A 2 -n -I'
function ggrep() {
case $1 in
'js' | 'javascript')
lang='javascript'
;;
'c' | 'c++' | 'cpp')
lang=c++
;;
'ruby' | 'rb')
lang=ruby
;;
'py' | 'python')
lang=python
;;
'sh' | 'bash' | 'zsh')
lang=bash
;;
'ocaml')
lang=ocaml
;;
esac
if [ -z $lang ]; then
langOpt='-g'
else
langOpt="-l$lang"
shift
fi
pattern=$1
shift
g \grep -B 1 -A 3 --break --heading --show-function --no-color -n -I -e $pattern -- $* | pygmentize $langOpt -O bg=dark,fg=light,full -f256 | \less -r
}
alias -g grpjs='ggrep \js'
# vim: ft=zsh
alias -g ga='git add'
# Full synchronisation
alias gsync='gpl && gps'
alias gcm="git commit -m '"