Created
September 13, 2014 14:12
-
-
Save gfreezy/4856d4bc414417ed6ff0 to your computer and use it in GitHub Desktop.
zsh plugin for go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gorun() { | |
$GOPATH/bin/$1 | |
} | |
function gosrc() { | |
cd $GOPATH/src/${1:-/github.com/gfreezy} | |
} | |
function gopkg() { | |
cd $GOPATH/pkg/${1:-darwin_amd64/github.com/gfreezy} | |
} | |
__gosrc_complete() { | |
_arguments -s -w : \ | |
'*:file:_path_files -/ -W $GOPATH/src' | |
} | |
__gopkg_complete() { | |
_arguments -s -w : \ | |
'*:file:_path_files -/ -W $GOPATH/pkg' | |
} | |
__gorun_complete() { | |
_arguments -s -w : \ | |
'*:file:_path_files -g "*(*)" -W $GOPATH/bin' | |
} | |
compdef __gosrc_complete gosrc | |
compdef __gopkg_complete gopkg | |
compdef __gorun_complete gorun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment