Browse code

Completions are git subdommand-aware now

Jakub Nawalaniec authored on 03/04/2011 at 13:43:39
Showing 1 changed files
... ...
@@ -2,15 +2,16 @@
2 2
 alias g='git'
3 3
 compdef g=git
4 4
 alias gst='git status'
5
-compdef gst=git
5
+compdef _git gst=git-status
6 6
 alias gl='git pull'
7
-compdef gl=git
7
+compdef _git gl=git-pull
8 8
 alias gup='git fetch && git rebase'
9 9
 compdef gup=git
10 10
 alias gp='git push'
11
-compdef gp=git
11
+compdef _git gp=git-push
12 12
 alias gd='git diff | mate'
13
-compdef gd=git
13
+# WTF is mate??
14
+compdef _git gd=git-diff
14 15
 alias gdv='git diff -w "$@" | vim -R -'
15 16
 compdef gdv=git
16 17
 alias gc='git commit -v'
... ...
@@ -18,20 +19,21 @@ compdef gc=git
18 18
 alias gca='git commit -v -a'
19 19
 compdef gca=git
20 20
 alias gco='git checkout'
21
-compdef gco=git
21
+compdef _git gco=git-checkout
22 22
 alias gb='git branch'
23
-compdef gb=git
23
+compdef _git gb=git-branch
24 24
 alias gba='git branch -a'
25 25
 compdef gba=git
26 26
 alias gcount='git shortlog -sn'
27 27
 compdef gcount=git
28 28
 alias gcp='git cherry-pick'
29
-compdef gcp=git
29
+compdef _git gcp=git-cherry-pick
30 30
 alias glg='git log --stat --max-count=5'
31
-compdef glg=git
31
+compdef _git glg=git-log
32 32
 
33 33
 # Git and svn mix
34 34
 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
35
+compdef git-svn-dcommit-push=git
35 36
 
36 37
 #
37 38
 # Will return the current branch name