Created
June 12, 2012 18:49
-
-
Save 1o1brian/2919347 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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