PyCharm 2023.3 Help

Highlight usages

The search command Highlight Usages in File Ctrl+Shift+F7 makes it possible to visualize usages of a symbol in the current file.

All found usages of a symbol in the current file are highlighted and color-coded, as defined in the Color Scheme settings page, to represent read or write access to the symbol. In addition to the highlights of occurrences in a text, the stripes of the same colors appear in the marker bar, accompanied by tooltips.

Highlight Usages in File

The behavior of usage highlighting is configurable: you can make PyCharm show usages of a symbol at caret automatically, or invoke it with a command.

Activating automatic highlighting of usages

  1. In the Settings dialog (Ctrl+Alt+S) , go to Editor | Code Editing.

  2. On the Code Editing page, select the Highlight usages of element at caret checkbox in the Highlight on Caret Movement area.

Highlighting usages of a symbol in the current file

  1. Place the caret at the selected symbol in the editor. If automatic usages highlighting is enabled, see all its occurrences in the current file highlighted. Otherwise, proceed to the next step.

  2. Go to Edit | Find Usages | Highlight Usages in File, or press Ctrl+Shift+F7.

Highlighted symbols in a file

To navigate among usages, do one of the following:

  • Click a stripe in the marker bar to navigate to the respective usage location.

  • Use the F3 and Shift+F3 keyboard shortcuts to navigate to the next and previous usages respectively.

  • To navigate between highlighted usages, press Ctrl + Alt (Option) + Up/Down on macOS. Alternatively, select Edit | Find Usages | Next Highlighted Usages or Edit | Find Usages | Previous Highlighted Usages from the main menu.

Removing highlighting

To remove highlighting of usages, press Escape.

Last modified: 07 March 2024