PyCharm 4.0.0 Web Help

In this section:

Overview

Navigate commands enable you to quickly jump to the desired classes, files, or symbols specified by names. PyCharm suggests a look-up list of matching names, from which you can select the desired one, and open it in the editor. This navigation honors CamelCase and snake_case capitalization . Refer to the tips for detailed list of available techniques.

Navigating by name

To navigate to a class, file or symbol with the specified name
  1. On the main menu, point to Navigate, and then choose Class, File, or Symbol respectively, or use the following shortcuts:
    • Class: Ctrl+NCtrl+NCtrl+NCtrl+NShift+Alt+GCtrl+CommaCtrl+OCtrl+Shift+T⌘ O⌘ NShift ⌘ T
    • File (directory): Ctrl+Shift+NCtrl+Shift+NCtrl+Shift+NCtrl+Shift+NCtrl+X, Ctrl+FCtrl+Shift+NShift+Alt+OCtrl+Shift+RShift ⌘ OShift ⌘ NShift ⌘ R
    • Symbol: Ctrl+Shift+Alt+NCtrl+Shift+Alt+NCtrl+Shift+Alt+NCtrl+Shift+Alt+NCtrl+Shift+Alt+NCtrl+Shift+Alt+NCtrl+Shift+Alt+OCtrl+Shift+Alt+NAlt ⌘ OShift Alt ⌘ NAlt ⌘ O
  2. In the pop-up window, start typing the desired name.

    So doing, you can enter characters located anywhere inside the desired name. As you type, the suggestion list shrinks, displaying the matching names only.

    • Class:

      py_gotoClass.png

    • File:

      py_gotoFile.png

    • 3.0+ Directory: use the same Ctrl+Shift+NCtrl+Shift+NCtrl+Shift+NCtrl+Shift+NCtrl+X, Ctrl+FCtrl+Shift+NShift+Alt+OCtrl+Shift+RShift ⌘ OShift ⌘ NShift ⌘ R shortcut as for file navigation, and type the name of the directory you are looking for, the pattern name ending with / or \:

      py_goto_dir

    • Symbol:

      py_gotoSymbol

      Note

      If there are several symbols with the same name, you can make your search more precise by specifying the hierarchy path. For example, if you want to find a certain function that belongs to different classes, you can type the function name, and see all possible locations in the look-up list. On the other hand, it is possible to specify the class or file name, followed by a dot, and then the desired function:

      py_gotoSymbol_1

  3. Double-click the desired entry in the suggestion list, or select it using the arrow keys, and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.

Tips and tricks

While working in the navigation pop-up window, use the following helpful techniques:

  • Narrow down the search scope by selecting the file types to search in. Just click the filter filter.png, and clear the check boxes next to the file types you are not interested in.
  • Include non-project files in the look-up list and thus make available matching files from SDKs and libraries.
  • If the look-up list is too long, type more characters to shrink it, or click the ellipsis sign at the end of the list, to reveal its next portion.
  • Type the initial letters of the CamelHumps names, for example:

    gotoFileCamelCaseNoShift.png

    Note that PyCharm automatically recognizes CamelHumps and matches them to the lower case letters.

  • Type any letters separated with spaces for snake_case names, for example:

    gotoFileSnakeCase.png

  • In the navigation to file pop-up window, type letters delimited with slashes to denote nested directories:

    gotoFileNestedDirectory.png

  • Type line number after a file name, delimited with a colon, to navigate to the specified line:

    py_gotoFileLineNumber

  • Use * wildcard to represent any number of characters, though it is quite enough to type characters located in the middle of the desired name.
  • If while typing in one of the Navigate to Class/File/Symbol pop-up windows you notice that you need another one, just invoke the necessary dialog box. The text you have already entered will not disappear.
  • Press Alt+F1Shift+Alt+1 or Alt+F1Shift+Alt+1Alt+F1Alt+F1Alt+F1Ctrl+Shift+1, Ctrl+Shift+2, Ctrl+Shift+3 or Ctrl+Shift+9Alt+F1Alt F1Alt F1Alt ⌘ W to invoke the Select Target pop-up window, and choose the desired IDE component.
  • Note that for the projects under version control, the entries in the look-up list are color coded according to their status:

    gotoFileVCS.png

  • When there is a detached editor frame with a certain file, you can opt to open this file in the main PyCharm frame by pressing EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter, or activate the detached frame by pressing Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter.
  • 3.4+Navigate| Class or Navigate | Symbol allows navigating to Python modules (*.py files) and packages ('__init__.py' files):

    py_goto_package

See Also

Procedures:

Reference:

Web Resources: