Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gigorok/16cc2be196c14cf7dc23 to your computer and use it in GitHub Desktop.
Save gigorok/16cc2be196c14cf7dc23 to your computer and use it in GitHub Desktop.
# For inclusion into a Rails config/environments/development.rb file.
if defined?(BetterErrors) && RUBY_PLATFORM.index('darwin')
url_schemes = `/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep bindings:.*:`
BetterErrors.editor = :macvim if url_schemes.index('mvim:')
BetterErrors.editor = :emacs if url_schemes.index('emacs:')
BetterErrors.editor = :textmate if url_schemes.index('txmt:')
BetterErrors.editor = :sublime if url_schemes.index('sublime:')
# RubyMine:
BetterErrors.editor = "x-mine://open?file=%{file}&line=%{line}" if url_schemes.index('x-mine:')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment