Skip to content

Instantly share code, notes, and snippets.

@drnic
Created April 26, 2011 16:25
Show Gist options
  • Save drnic/942597 to your computer and use it in GitHub Desktop.
Save drnic/942597 to your computer and use it in GitHub Desktop.
function use_textmate () {
export EDITOR="/usr/local/bin/mate -w"
export GEM_OPEN_EDITOR="/usr/local/bin/mate"
alias tm_dialog=~/"Library/Application\ Support/TextMate/PlugIns/Dialog.tmplugin/Contents/Resources/tm_dialog"
}
function use_redcar_gem () {
export EDITOR="rvm jruby exec redcar -w"
export GEM_OPEN_EDITOR="redcar"
}
function use_redcar_dev () {
export PATH="/Users/drnic/Projects/ruby_apps/redcar/bin:$PATH"
export EDITOR="rvm jruby exec redcar -w"
export GEM_OPEN_EDITOR="redcar"
}
# don't try to run redcar if jruby not installed
if rvm list strings | grep -q jruby
then
use_redcar_dev
else
use_textmate
fi
function m {
if [ "$1" != "" ]; then
$EDITOR $1
else
$EDITOR .
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment