Skip to content

Instantly share code, notes, and snippets.

@1o1brian
Created June 12, 2012 18:49
Show Gist options
  • Save 1o1brian/2919347 to your computer and use it in GitHub Desktop.
Save 1o1brian/2919347 to your computer and use it in GitHub Desktop.
# thanks to railscasts
class Object
# macvim
def mvim(method_name)
file, line = method(method_name).source_location
`mvim #{file} +#{line}`
end
# sublime text
def subl(method_name)
file, line = method(method_name).source_location
`subl #{file}:#{line}`
end
# textmate
def mate(method_name)
file, line = method(method_name).source_location
`mate '#{file}' -l #{line}`
end
end
# examples:
helper.mvim(:link_to) # opens the link_to helper definition in mac vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment