I'm using Sublime 2 for Ruby On Rails programming. I need a ability to click a method name and jump to class where the method is defined. There are many IDE with similar capability...
-
1As a textmate switcher I've been missing this. – Alex Wayne Apr 23 '12 at 18:59
-
But currently there is no such option. Am I right? – Lesha Pipiev Apr 23 '12 at 19:07
-
Sublime text 3 now has this feature (http://www.sublimetext.com/blog/articles/sublime-text-3-beta), though I don't know if upgrading to ST3 works for you. – Alexander Bird Sep 09 '13 at 14:58
-
Thanks Alexander, I already know about it. – Lesha Pipiev Sep 10 '13 at 19:51
-
Compared some plugins for ST here. Although I'm using Python, most of these plugins aren't python specific http://stackoverflow.com/questions/18914386/sublime-text-2-3-setup-for-python-django-with-code-completion – user Apr 03 '14 at 05:41
3 Answers
Goto symbol
is Ctrl-R (linux), this gives a pop-up-list of all symbol and class definitions in the file, in definition order, and you can jump to what you're after. You could do the same thing with Goto Anything
, Ctrl-P and then typing @ and the method name.
Also, there is a Goto Symbol plugin, which lets you jump straight to the definition of the method name your cursor is at, with a key binding or click.
However, both those methods are limited to the current file. If you need to jump to definitions in other files, probably the best solution is the SublimeCodeIntel plugin. It seems to be working pretty well and just by hitting Ctrl-f3 (linux) will open up the file at the definition you want.

- 702
- 5
- 12

- 34,470
- 11
- 98
- 102
-
1superb advie thanks re sublimecodeintel - the lack of a find-in-project command is a remarkable omission from Sublime I was about to ditch it and go back to BBedit until I found your post – jpw Aug 13 '12 at 00:14
-
3this is a good answer but unfortunately SublimeCodeIntel seems quite buggy, so my advice is to not waste time with it and try CTags instead as suggested by @alienhard – pic Aug 31 '12 at 07:58
Another solution is CTags.
SublimeCodeIntel seems to be pretty buggy judging from unresolved issues on the Github tracker. Also it crashes for me, probably because the code base I'm working on is too big...
What I'm using now is the CTags package. There's no "intelligence" but it allows you to jump to definitions and back very easily and it is super fast.

- 14,559
- 17
- 68
- 96

- 14,376
- 9
- 37
- 28
-
How to do this process.I tried ctrl+click in the function call.but it is not jumping to function definition – shajin Mar 27 '13 at 06:02
-
1I'm using these custom mappings: { "command": "navigate_to_definition", "keys": ["ctrl+option+]"] }, { "command": "jump_back", "keys": ["ctrl+alt+["] }, but obviously you can define your own. – alienhard Apr 12 '13 at 05:17
-
2The problem is that it can only go to function definitions, but can't find variable definitions. – duleshi Sep 03 '13 at 03:43
-
For spanish layout: `{ "keys": ["ctrl+alt+x"], "command": "navigate_to_definition"}, { "keys": ["ctrl+alt+z"], "command": "jump_back"}` – Igor Parra Sep 30 '13 at 16:13
-
been 3 years, I wonder if they have any new package available to solve the issue of finding variable definitions – SandBag_1996 Feb 02 '16 at 17:16
upgrade to sublime text 3 and then put cursor on function name and click F12 to go back ALT+- or from the menu click on Goto

- 1,252
- 15
- 22