Skip to content

Instantly share code, notes, and snippets.

@davidlee
Created March 18, 2011 04:34
Show Gist options
  • Save davidlee/875621 to your computer and use it in GitHub Desktop.
Save davidlee/875621 to your computer and use it in GitHub Desktop.
exportgems() {
export GEMPATH=`gem env gempath | sed 's/:.*$//'`/gems
}
exportgems;
# completion fuction for compdef: just lists the gems folders
_gems() { compadd `cd $GEMPATH; echo *` }
compdef _gems gcd ; gcd() { cd $GEMPATH/$1 }
compdef _gems gedit ; gedit() { mate $GEMPATH/$1 }
compdef _gems ggrep ; ggrep() { grep -r $1 $GEMPATH/$2 }
compdef _gems grak ; grak() { rak $1 $GEMPATH/$2 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment