Permalink
Browse files

completion for git

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent 04c7f96 commit 73e3c97e88a67874805d3f435a18ce550bbe8e7d @hxw committed Aug 24, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 tcshrc
View
13 tcshrc
@@ -1,3 +1,4 @@
+#!/bin/tcsh
# .tcshrc
# A righteous umask
@@ -160,19 +161,25 @@ if ($?prompt) then
cwdcmd
endif
+ # dd
complete dd c/--/"(help version)"/ c/\[io\]f=/f/ \
c/conv=\*,/"(ascii ebcdic ibm block unblock lcase notrunc ucase swab noerror sync)"/,\
c/conv=/"(ascii ebcdic ibm block unblock \
lcase notrunc ucase swab noerror sync)"/,\
c/\*=/x:'<number>'/ \
n/\*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
+ # git
+ set gitcmds = ( `ls -1 /usr/local/libexec/git-core/git-* | sed 's@^/usr/local/.*/git-@@g'` )
+ complete git "p/1/(${gitcmds})/" 'n/branch/`git branch|cut -c 3-`/' 'n/co/`git branch|cut -c 3-`/' 'n/remote/(show add rm prune update)/' 'N/remote/`git remote`/'
# for fun
test -x /usr/games/pom && /usr/games/pom
endif
# additional customisation
-foreach script (${HOME}/bin/AutoStart.*)
- source ${script}
-end
+if (-d "${HOME}/bin") then
+ foreach script (${HOME}/bin/AutoStart.*)
+ source ${script}
+ end
+endif

0 comments on commit 73e3c97

Please sign in to comment.