“Find Definition” Textmate Command
Features
- find ruby method, class and module definitions
- search in textmate project and your rubygems directory
- open matching results directly in textmate at exact line
- ide like search and browse feeling
- support for custom search path
Installation
clone this repository
git clone git://github.com/jzimmek/finddef.git
setup textmate directories
mkdir -p ~/Library/Application\ Support/TextMate/Bundles/Ruby.tmbundle/Commands
copy finddef to your ruby commands directory
cp ./finddef/Find\ Definition.tmCommand ~/Library/Application\ Support/TextMate/Bundles/Ruby.tmbundle/Commands/
restart textmate or reload bundles.
you show see a new command “Bundles > Ruby > Find Definition”.
Usage
choose a method, class or module by placing the cursor above it and press
^-
finddef will automatically open the matching file when only one match exists, otherwise you can choose from a dialog which file to open.
Search Path
By defaut finddef searches in your open project directory and your rubygems in “/Library/Ruby/Gems/<any>/gems/<any>/lib”.
You can speficy an additional path. Add a new shell variable in TextMate
TextMate > Preferences > Advanced > Shell Variables
Variable: TM_FINDDEF_PATH
Value:
example (simple):
Value: /Users/jzimmek/projects
example (multiple comma separated)
Value: /Users/jzimmek/projects/prj1/lib,/Users/jzimmek/legacy/prjX,…
Contact
You found a bug, have installation problem or simply like finddef ?
Let me know: jan.zimmek at web.de
Credits
finddef is inspired by “Go To Helper Method” and “EasyOpen”.
http://heycarsten.com/2008/6/12/go-to-helper-method-textmate-command