Skip to content

Instantly share code, notes, and snippets.

@markburns
Created October 25, 2013 09:25
Show Gist options
  • Save markburns/7152000 to your computer and use it in GitHub Desktop.
Save markburns/7152000 to your computer and use it in GitHub Desktop.
editor = ENV['EDITOR']
mapping = {
[:textmate, :txmt, :tm] => :textmate,
[:sublime, :subl, :st] => :sublime,
[:macvim, :mvim, :vim] => :macvim
}
mapping.each do |matches, value|
matches.each do |m|
if editor =~ /#{m.to_s}/
BetterErrors.editor = value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment