Skip to content

Instantly share code, notes, and snippets.

@davidlee
Created March 19, 2010 03:35
Show Gist options
  • Save davidlee/337198 to your computer and use it in GitHub Desktop.
Save davidlee/337198 to your computer and use it in GitHub Desktop.
# gem completions
# this is a guess. salt to taste.
export GEM_SEARCH_PATH=`ruby -e 'require "rubygems"; puts Gem.path.first'`/gems
# completion fuction for compdef: just lists the gems folders
_gems() { compadd `cd $GEM_SEARCH_PATH; echo *` }
compdef _gems gemcd ; gemcd() { cd $GEM_SEARCH_PATH/$1 }
compdef _gems gemedit ; gemedit() { mate $GEM_SEARCH_PATH/$1 }
compdef _gems gemgrep ; gemgrep() { grep -r $1 $GEM_SEARCH_PATH/$2 }
compdef _gems gemrak ; gemrak() { rak $1 $GEM_SEARCH_PATH/$2 }
alias gme="gemedit $1"
alias gmc="gemcd $1"
alias gmr="gemrak $1 $2"
alias ghe="ghedit $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment