Navigating through the source code
You can quickly navigate within your source code using different action such as autoscroll, bookmarks, or the Select In pop-up. You can also look up a symbol declaration and its type, see implementations, and quick definitions.
Navigate with Select In to a target in the Project view
You can automatically locate a target in the Project tool window.
If the file in question is opened in the editor, press Alt+F1 for the Select in pop-up.
- In the pop-up, select Project View and press Enter.
CLion locates your target in the Project View window.
Use Autoscroll to locate a file
You can use the scroll to and from actions to locate your file in the Project view.
In the Project tool window, right-click the Project area.
From the context menu, select Autoscroll from Source. CLion tracks a file that is currently open in the editor and locates it in the Project view automatically.
You can also select the Autoscroll to Source option. In this case, when you click a file in the Project view, CLion will automatically open it in the editor.
Use bookmarks for navigation
You can add a bookmark to any line of your code.
- On the desired line of code, press the following shortcuts:
F11 to create an anonymous bookmark.
Press Ctrl+F11 and select a number or a letter to create a book mark with mnemonics.
Press N/A or N/A to show next or previous bookmark.
Press Shift+F11 to open the Bookmarks dialog where you can manage bookmarks, for example, you can delete, sort bookmarks, or supply them with a brief description.
If you have a bookmark with letter mnemonics, press Shift+F11 and press the letter you need. CLion returns you back to the editor and to the corresponding bookmark.
If you need to navigate to an existing bookmark with number mnemonics, press Ctrl and the bookmark's number.
Every created bookmark is reflected in the Favorites (Alt+2) tool window which you can also use for navigation to your bookmarks.
Use breadcrumbs for navigation
Breadcrumbs help keeping track of your location inside the hierarchy of scopes in the file opened in the active editor tab. For C++, breadcrumbs represent namespaces, classes, structures, functions, and lambdas: To jump to an element in the code, click the breadcrumb with its name.
By default, breadcrumbs are shown and positioned at the bottom of the editor. To hide or relocate them, right-click a breadcrumb and choose Breadcrumbs | Top or Breadcrumbs | Don't show, or configure their placement in .
In the same Breadcrumbs settings dialog, you can also enable/disable breadcrumbs for a particular language by selecting/clearing the corresponding checkbox.
To configure colors for breadcrumbs highlighting, go to , and choose Editor | Breadcrumbs from the list.
Go to declarations
You can navigate to declaration of a variable, function, class, or type from its usage:
Place a caret at a symbol in question and press Ctrl+B.
For a type declaration, press Ctrl+Shift+B.
You can also point to the symbol keeping Ctrl pressed, and click, when it turns to a hyperlink. The pop-up message will show the declaration information: Click once again to navigate to the declaration.
Go to definitions
You can keep track of class implementations and overriding functions using either the / , / gutter icons or the appropriate shortcuts.
Press Ctrl+Alt+B to navigate to the definition of a code entity at the caret (variable, function, class).
Press Ctrl+U to navigate to the super definition.
Locate the source code element with Structure view
You can use the structure view pop-up to locate a code element in the file you are working on.
Press Ctrl+F12 to open the structure view pop-up.
In the pop-up, locate the item you need. You can start typing the name of the element and CLion narrows down the search. Press Enter to return back to the editor, and the corresponding element.
Moreover, you can visually separate methods in your code. To do that, open the Show method separators option.(Ctrl+Alt+S) dialog, go to and select the