PhpStorm - Navigate to method

28,138

Solution 1

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

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.

Solution 3

Please see the screenshot and find out the shortcut key for your OS. PHPStorm Menu bar > Navigate dropdown

Share:
28,138
priktop
Author by

priktop

Updated on July 08, 2022

Comments

  • priktop
    priktop almost 2 years

    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?

  • Petr 'PePa' Pavel
    Petr 'PePa' Pavel almost 10 years
    Just to point out an insufficiency: As of version 7.1.3, you can't filter by class name and method name at the same time. If you're looking for a method that exists in plenty in your project, you'll have to wait.
  • aaronbauman
    aaronbauman over 9 years
    IMO this behavior is sub-optimal compared to Sublime Text or Text Mate. There is no quick way to jump between symbols in the same file. The "File Structure" menu is not filterable, and the other navigation tools work only globally.
  • antriver
    antriver about 9 years
    @aaronbauman It seems to work like sublime text in phpstorm 8 at least. The box that pops up for Navigate > File Structure allows you to just start typing and it will filter the results: ctrlv.in/517640
  • aaronbauman
    aaronbauman about 9 years
    I did manage to find that popup, which will accept typing, but not paste text. So, better than nothing, but still sub-optimal.
  • chudasamachirag
    chudasamachirag almost 6 years
    for Ubuntu CTRL + F12