Skip to content

Instantly share code, notes, and snippets.

@gfreezy
Created September 13, 2014 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfreezy/4856d4bc414417ed6ff0 to your computer and use it in GitHub Desktop.
Save gfreezy/4856d4bc414417ed6ff0 to your computer and use it in GitHub Desktop.
zsh plugin for go
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