Bookmarks and Favorites for Navigating Large Magento Codebases
AI generated
IDE
{ }
PhpStorm · Magento · Navigation
Bookmarks and Favorites for Large Magento Codebases
Systematic navigation instead of endless scrolling

A Magento module typically spreads across dozens of files in deeply nested directories: di.xml, plugin classes, observers, blocks, and templates. PhpStorm's Bookmarks for individual lines and Favorites for entire files and folders turn this web into a navigable structure, provided you use them systematically instead of randomly.

13 min read Bookmarks Favorites Navigation Magento

1. Why navigation in large Magento codebases is a problem

Magento's modular architecture deliberately spreads related functionality across many small files: a single functional change often touches a di.xml for dependency injection configuration, a plugin class for the actual logic, a layout XML for the frontend wiring, and a template for the presentation, spread across four or five different directory levels. This separation makes architectural sense, but it turns simply relocating already known spots into a recurring time sink.

Search Everywhere and Go to Class help find a file for the first time, but they are cumbersome for repeated jumps between a fixed group of related files, for instance during a multi day feature build, because the filename has to be typed again on every jump. This recurring need is exactly what Bookmarks and Favorites are for: a permanent, one time set up shortcut to a known spot in the code.

2. Bookmarks for individual lines of code

A bookmark marks a single line in a file, shown as a small icon in the left gutter of the editor, set via F11 or right click on the line number, Bookmarks, Toggle Bookmark. Unlike a TODO comment, which stays visible in the code itself and gets committed along with it, a bookmark exists only locally in the given developer's IDE configuration and has zero effect on the actual source code.

This makes bookmarks ideal as purely personal orientation points during an ongoing task: the line where a price calculation begins, the entry point of a plugin interceptor, or the spot where an open question about the business logic hangs. Once the task is done, all bookmarks can be cleared together from the Bookmarks window without ever leaving a trace in the code or the Git history.

3. Mnemonic bookmarks with keyboard shortcuts

Shift+Ctrl+F11 (on macOS Cmd+F11) opens a digit selector that links a bookmark directly to a digit from 0 to 9 or a letter, a so called mnemonic bookmark. Jumping there afterward happens with Ctrl+digit, with no detour through a window or a list, which makes it the fastest navigation method PhpStorm offers for up to ten regularly visited spots.

In practice a fixed, personal scheme pays off: digit 1 for the current feature's entry point, digit 2 for the corresponding test class, digit 3 for the relevant di.xml, and so on. Because the digits can be assigned consistently across projects, a kind of muscle memory builds up over time that noticeably speeds up context switching between several Magento projects worked on in parallel.


Setting and using a mnemonic bookmark:

1. Place the cursor on the desired line
2. Shift+Ctrl+F11 (macOS: Cmd+F11)
3. Pick digit 0-9 or a letter -> the bookmark is linked

Jump: Ctrl+<digit> (macOS: Cmd+<digit>)

Show all bookmarks: Ctrl+F11 -> Bookmarks window
Remove a bookmark: F11 on the marked line (toggle)

4. Favorites for files and folders

While a bookmark is tied to a single line, a favorite references an entire file, a folder, or even a single symbol such as a class or method, independent of the current cursor position within it. A favorite is set via Alt+Shift+F on a file in the project tree or an open editor tab, which adds the file to a named favorites list in the tool window of the same name.

The practical difference from bookmarks shows up in longer running tasks: a bookmark is suited for quickly jumping back to a specific line of code during an active session, while a favorite is meant for permanently assembling every file that belongs to a given module or feature, regardless of which line inside it happens to be relevant right now.

5. Organizing Favorites by feature and module

The Favorites window allows several independent, named lists at once, which works well for keeping a dedicated list per active feature or bug fix, for example SeoSuite-Hreflang-Fix or Checkout-Discount-Feature. Within a list, files can be dragged into a meaningful order, for instance from the configuration file through the logic class to the template, so the list itself already sketches a kind of map of the change.

Finished lists do not need to be deleted right away: a favorites list for an already shipped feature often stays valuable if a related bug surfaces in exactly that area months later, because it already bundles the relevant files, sparing you from starting the search completely from scratch.

6. A concrete Magento module as a favorites set

For a typical plugin module with an observer and its own block, the following favorites set works well: the di.xml for the plugin registration, the plugin class itself with the actual before or after method, the observer class along with its events.xml, the block, and the corresponding phtml template. All five or six files land in a single favorites list, letting you switch between configuration, logic, and presentation with a single click during development.

This approach speeds up onboarding considerably, especially when debugging an unfamiliar module: instead of navigating via Find Usages or the project tree again on every jump, you build up a favorites list directly during the first exploration, which then serves as a personal map through the module for the rest of the task.


Example favorites list "SeoSuite-Hreflang-Fix":

1. app/code/Mironsoft/SeoSuite/etc/di.xml
2. app/code/Mironsoft/SeoSuite/Plugin/HreflangPlugin.php
3. app/code/Mironsoft/SeoSuite/Observer/StoreSwitchObserver.php
4. app/code/Mironsoft/SeoSuite/etc/events.xml
5. app/code/Mironsoft/SeoSuite/Block/Hreflang.php
6. app/code/Mironsoft/SeoSuite/view/frontend/templates/hreflang.phtml

Creating it: select a file in the project tree -> Alt+Shift+F
             -> create "SeoSuite-Hreflang-Fix" as a new list

7. Combining with Search Everywhere and Go to Class

Bookmarks and Favorites do not replace Search Everywhere (double Shift) and Go to Class (Ctrl+N), they complement them at different points in the workflow: search suits the one time, targeted discovery of a still unfamiliar file, while bookmarks and favorites are meant for repeatedly returning to already known, relevant spots without retyping the filename each time.

In practice a natural order tends to emerge: a new, unfamiliar file is first found via Search Everywhere, and only once it turns out that this file stays relevant beyond the current task does it move into the permanent, personal navigation structure as a favorite or bookmark.

8. Team sharing: what is possible and what is not

Both bookmarks and favorites are, by default, purely local, personal IDE settings that neither land in the project repository nor get automatically shared with colleagues, which means a new team member starts from zero. There is no built in mechanism to send a favorites list directly to another developer, which is a drawback for structured onboarding documentation.

A pragmatic workaround for genuinely important, permanently relevant groups of files is instead a short list of relevant paths in a module's README or a project internal wiki article, which every new developer then manually rebuilds as their own favorites list. For purely personal work organization during a single task, on the other hand, the lack of team sharing is not a real problem, since bookmarks were never meant to be permanent anyway.

9. Practical tips and tool comparison

A proven pattern is to use mnemonic bookmarks exclusively for the currently active task and to clear them consistently once it is done, while favorites lists get created for permanently relevant module structures and kept around for weeks or months. Mixing the two tools, for example permanent digit bookmarks for ten different, simultaneously active projects, quickly leads to losing track of which digit currently stands for what.

The table below compares bookmarks, favorites, Search Everywhere, and classic TODO comments as four different navigation tools, measured by scope, typical lifetime, and visibility to other team members.

Tool Scope Typical lifetime Visible to team
Mnemonic bookmark Single line Duration of a task No, purely local
Favorites list Files/folders, grouped Weeks to permanent No, purely local
Search Everywhere Entire project One time search N/A, no state
TODO comment Single line in code Until addressed Yes, visible in source

Mironsoft

PhpStorm setup, Docker integration, and team productivity

PhpStorm that actually runs optimally for Magento and PHP projects?

We review existing PhpStorm setups for slow indexing, unused Docker integration, and missing team conventions, then set up a configuration that is productive from the first second.

Setup Review

Optimizing indexing, interpreter, and memory settings for large Magento projects.

Docker Integration

Cleanly connecting Xdebug, PHPUnit, and database tools to the Docker setup.

Team Conventions

Standardizing inspection profiles, code style, and live templates project-wide.

10. Summary

Bookmarks and Favorites: The Essentials at a Glance

Bookmarks

F11 for simple bookmarks, Shift+Ctrl+F11 for mnemonic bookmarks with a digit shortcut.

Favorites

Alt+Shift+F on files/folders, organized into named lists per feature.

Purely local

Both tools are personal IDE settings, not visible team wide.

Combination

Bookmarks for the current task, favorites for permanently relevant module structures.

11. FAQ: Bookmarks and Favorites: The Essentials at a Glance

1What is the difference between bookmarks and favorites in PhpStorm?
A bookmark marks a single line in a file, a favorite references an entire file, a folder, or a symbol regardless of a specific line within it.
2How do I set a mnemonic bookmark?
Place the cursor on the desired line, then press Shift+Ctrl+F11 on Windows and Linux, or Cmd+F11 on macOS, and pick a digit from 0 to 9 or a letter.
3How do I jump to a mnemonic bookmark?
With Ctrl+digit on Windows and Linux, or Cmd+digit on macOS, with no detour through a window or a list.
4Do bookmarks become visible in the source code or the Git history?
No. Bookmarks exist only in the given developer's local IDE configuration and have zero effect on the source code or the repository.
5How do I create a favorites list for a Magento module?
Via Alt+Shift+F on a file in the project tree, then create a new, named list. Further files can be added to the same list the same way afterward.
6Can I share favorites lists with colleagues?
Not directly, there is no built in sharing mechanism. A short path list in the module README works as a workaround, which every developer then manually rebuilds as their own favorites list.
7Do bookmarks and favorites replace searching via Search Everywhere?
No, they complement it. Search Everywhere suits the one time discovery of an unfamiliar file, bookmarks and favorites suit repeatedly returning to already known spots.
8Should I clear bookmarks once a task is finished?
Yes, that is the recommended practice, since bookmarks are meant for the currently active task. Permanently relevant groups of files belong in a favorites list instead.
9How many mnemonic bookmarks can I use at once?
Digits 0 through 9 plus additional letters allow linking well over ten bookmarks at once, though in practice a fixed, manageable personal scheme works best.
10Can a favorite point to a single method instead of an entire file?
Yes, favorites can also be set on individual symbols such as a class or method, not only on complete files or folders.