PhpStorm - Navigate to method
IdeKeyboard ShortcutsPhpstormIde Problem Overview
In a class, I quickly want to navigate to, let's say, the indexAction method. In SublimeText I could press cmd + R, type 'inde', and hit enter on the dropdown that shows all the results from my search.
I haven't found this in PhpStorm, is this functionality available?
Ide Solutions
Solution 1 - Ide
Navigate
| Symbol...
(CtrlAltShiftN in the default keymap on Windows/Linux, CmdAltShiftN with Mac OS X keymap, CmdAltO in Mac OS X 10.5+ keymap).
Help
| Find Action
, type symbol
to see shortcut in your keymap.
The above works globally across the project, for the current file only use Navigate
| File Structure
(or CmdF12 on Mac OS X 10.5+) and start typing the method name to narrow down the results, hit Enter to navigate to the selected method.
Related help sections:
Solution 2 - Ide
I also do this in Sublime Text with CMD + R and then look for the method via @
.
I think the closest way of doing this in PhpStorm 8 & 9 is using the
CMD + F12 (perhaps CTRL + F12 in Windows)
which lists all the methods in the current class and then type the name of the method to navigate to it.
OPTIONAL / SUPPLEMENTARY
To avoid confusion from switching to Sublime Text
and back to PhpStorm
I decided to bind it CMD + R that way I won't have to adjust again.
In PhpStorm
there is an easy way to see if there is a conflict with your keybinding so I decided to migrate my Sublime Text
shortcuts to PhpStorm
instead of the other way around.
Under PhpStorm > Preferences > Keymap
you would see a button just beside the search field and check if your command has a conflict in our case we want to bind CMD + F12 to CMD + R to just try that key stroke if it's bound to other command.
Otherwise bind it to Main Menu > Navigate > File Structure
.
Hope that helps.