Use Autoscroll to locate a file

You can use the Autoscroll to Source and Autoscroll from Source actions to locate your file in the Project tool window.

In the Project tool window, right-click the Project toolbar and from the context menu select Autoscroll from Source. After that PhpStorm will track the file that is currently opened in the active editor tab and locate it in the Project tool window automatically.

You can also select the Autoscroll to Source option. In this case, when you click a file in the Project view, PhpStorm will automatically open it in the editor.

Use bookmarks for navigation

To create an anonymous bookmark, place the caret at the needed code line and press F11.

To create a bookmark with mnemonics, place the caret at the needed code line, press Ctrl+F11 and select a number or a letter for the mnemonics.

To show the next or the previous bookmark, in the main menu select Navigate | Bookmarks | Next Bookmark or Navigate | Bookmarks | Previous Bookmark.

To open the Bookmarks dialog, press Shift+F11. You can use this dialog to manage bookmarks, for example, delete, sort bookmarks, or supply them with a brief description.

To navigate to an existing bookmark with letter mnemonics, press Shift+F11 and then press a letter you need. PhpStorm returns you to the editor and to the corresponding bookmark.

To navigate to an existing bookmark with number mnemonics, press Ctrl and the bookmark's number.

Every created bookmark is reflected in the FavoritesAlt+2 tool window which you can also use for navigation to your bookmarks.

Go to declaration and its type

You can navigate to the initial declaration of a symbol and symbol's type from its usage.

Place the caret at the desired symbol and press Ctrl+B.

Alternatively, keeping Ctrl pressed, hover your mouse pointer over the symbol. When the symbol turns into a hyperlink, its declaration will be displayed in the tooltip. Click the hyperlink without releasing the key to open the declaration in the editor.

For a type declaration, press Ctrl+Shift+B.

Alternatively, keeping Ctrl+Shift pressed, hover your mouse pointer over the symbol. When the symbol turns into a hyperlink, its type declaration will be displayed in the tooltip. Click the hyperlink without releasing the keys to open the type declaration of the symbol in the editor.

Invoking Go to Type Declaration on $a will move the caret to the variable's type, class D.

Invoking Go to Type Declaration on the f method in $a->f() will move the caret to the declaration of the class returned by this method, class C.

Invoking Go to Declaration on the f method in $a->f() will move the caret to this method's declaration within class D.

Go to implementation

You can keep track of class implementations and overriding methods either using the gutter icons or pressing the appropriate shortcuts.

Click one of the / , / gutter icons and select the desired ascendant or descendant class from the list.

To navigate to the super method, press Ctrl+U.

To navigate to the implementation, press Ctrl+Alt+B.

Navigate between changes

If you edit a file that is under version control, PhpStorm provides several ways to move back and forth with the updates. In particular, you can use the navigation commands, keyboard shortcuts, and the change markers.

To navigate to the place of your last edit, press Ctrl+Shift+Backspace or select Navigate | Last Edit Location from the main menu.

Navigate between errors or warnings

To jump to the next or previous found issue in your code, press F2 or Shift+F2 respectively. Alternatively, from the main menu, select Navigate | Next / Previous Highlighted Error.

PhpStorm places the caret immediately before the code issue.

Configure the way PhpStorm navigates between code issues: it can either jump between all code issues or skip minor issues and only navigate between detected errors. Right-click the code analysis marker in the scroll bar area and choose one of the available navigation modes from the context menu:

To have PhpStorm skip warnings, infos, and other minor issues, choose Go to high priority problems only.

To have PhpStorm jump between all detected code issues, choose Go to next problem.

Locate a code element with the Structure view popup

You can use the structure view popup to locate a code element in the file you are working on.

To open the structure view popup, press Ctrl+F12.

In the popup, locate an item you need. You can start typing a name of the element for PhpStorm to narrow down the search. Press Enter to return to the editor and the corresponding element.

While in the popup, you can sort file members, see anonymous classes and inherited members.

Browse through methods

Press Alt+Down or Alt+Up.

For JavaScript code inside HTML files, this behavior depends on the caret location. If the caret rests inside a JavaScript block, it enables jumping between JavaScript functions. If the caret rests on a <script> tag, then navigation is performed between the tags.

To visually separate methods in code, in the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General | Appearance and select the Show method separators option.

To open the Structure tool window, press Alt+7.

Use the Lens mode

The lens mode lets you preview your code without actually scrolling to it. The mode is available in the editor by default when you hover your mouse over the scrollbar. It is especially useful when you hover over a warning or an error message.

To disable the lens mode, right-click the code analysis marker located on the right side of the editor and in the context menu clear the Show code lens on the scrollbar hover checkbox.

As an alternative, in the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General | Appearance and clear the Show code lens on the scrollbar hover checkbox.

Use breadcrumbs for navigation

You can navigate through the source code with breadcrumbs that show names of classes, variables, functions, methods, and tags in the currently opened file. By default, breadcrumbs are enabled and displayed at the bottom of the editor.

To change the location of breadcrumbs, right-click a breadcrumb, in the context menu select Breadcrumbs and the location preference.

To edit the breadcrumbs settings, in the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General | Breadcrumbs.

Clear the Show breadcrumbs option to hide breadcrumbs in the editor.

Navigate to a file with the Navigation bar

Use the Navigation bar as a handy tool to find your way across the project.

Press Alt+Home to activate the Navigation bar.

Use the arrow keys or the mouse pointer to locate the desired file.

Double-click the selected file, or press Enter to open it in the editor.

Find a line or a column

In the editor, press Ctrl+G.

In the Go to Line/Column dialog, specify a line or column number, or both, separating them with: and click OK.

If you don't want to see the line numbers in the editor, in the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General | Appearance and clear the Show line numbers checkbox.

Find the caret, edited line, or edited location

To find the current caret location in the editor, press Ctrl+M. This action might be helpful if you do not want to scroll through a large file.

However, you can press the Up and Down arrow keys to achieve the same result.

To highlight a word at the caret you are trying to locate, select Edit | Find | Find Word at Caret from the main menu.

To see on what element the caret is currently positioned, press Alt+Q.

To see the previous caret position, press Ctrl+Alt+Left. To move forward, press Ctrl+Alt+Right.

To toggle between the starting and ending code block braces, press Ctrl+Shift+M.

To navigate between code blocks, press Ctrl+Shift+[ or Ctrl+Shift+].

To navigate to the last edited location, press Ctrl+Shift+Backspace.

Move the caret

You can use different actions to move the caret through code. You can also configure where the caret should stop when moved by words and on line breaks.

To move the caret to the next word or the previous word, press Ctrl+Right or Ctrl+Left.

By default, PhpStorm moves the caret to the end of the current word. You can configure the position of the caret when you use these actions.

In the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General. In the Caret Movement section, use the When moving by words and Upon line break options to configure the caret's behavior.

To move the caret forward to the next paragraph or backward to the previous one, press Ctrl+Shift+A and search for the Move Caret Forward a Paragraph or Move Caret Backward a Paragraph action.

You can also select a text and then move the caret forward or backward to a paragraph. Press Ctrl+Shift+A and search for the Move Caret Forward a Paragraph with Selection or Move Caret Backward a Paragraph with Selection action.