Created
December 30, 2009 12:14
-
-
Save adonaldson/266009 to your computer and use it in GitHub Desktop.
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
# Add the following to your .bash_profile for auto-completion | |
# (e.g. mvimgem <tabtab>) | |
# | |
# Modified to work with mvim instead of Textmate | |
# Original: http://effectif.com/articles/opening-ruby-gems-in-textmate | |
_mvimgem() | |
{ | |
local curw | |
COMPREPLY=() | |
curw=${COMP_WORDS[COMP_CWORD]} | |
local gems="$(gem environment gemdir)/gems" | |
COMPREPLY=($(compgen -W '$(ls $gems)' -- $curw)); | |
return 0 | |
} | |
complete -F _mvimgem -o dirnames mvimgem |
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
#!/bin/sh | |
# | |
# Modified to work with mvim instead of Textmate | |
# Original: http://effectif.com/articles/opening-ruby-gems-in-textmate | |
# | |
usage() | |
{ | |
echo "Usage: $(basename $0) <gem>" 1>&2 | |
exit 1 | |
} | |
GEM="$1" | |
[ -z "$GEM" ] && usage | |
mvim "$(gem environment gemdir)/gems/$GEM" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment