
The most recent switched file is always at the top of the list. While searching for the target file, Go to Header/Source uses a few heuristics: The action either opens a file in the editor right away or shows the popup with the available options: To invoke Go to Header/Source, press F10 or call Navigate | Header/Source from the main menu. To switch between source and header files, you can use the dedicated Go to Header/Source action instead of Go to Related Symbol. Press Ctrl+U to navigate to the super definition.
#Recent locations code#
Press Ctrl+Alt+B to navigate to the definition of a code entity at the caret (variable, function, class). You can keep track of class implementations and overriding functions using either the /, / gutter icons or the appropriate shortcuts. If you select Jump to predeclaration, the action navigates you to the declaration if it exists: Go to definitions You can choose between the first two options using the switcher in Settings | Editor | General: When invoked on a definition, it shows the associated declaration. When invoked on a declaration, it shows the list of that declaration’s usages. When invoked on a symbol usage, it navigates to that usage’s declaration. The Go to Declaration or Usages action ( Ctrl+Shift+B) works differently for different cases: Click once again to navigate to the declaration. The popup message will show the declaration information. You can also point to the symbol keeping Ctrl pressed, and click, when it turns to a hyperlink. Place a caret at a symbol and press Ctrl+B.įor a type declaration, press Ctrl+Shift+B. You can navigate to the declaration of a variable, function, class, or type from its usage:

Keep in mind that the deleted location is also removed from the list of entries that you access with the Ctrl+Alt+Left shortcut. To delete a location entry from the search results, press either Delete or Backspace. You can search by the code text, filename, or breadcrumbs. To search for a code snippet, in the Recent Locations popup, start typing your search query. While in the popup, use the same shortcut or select the Show changed only checkbox to see only the locations with changed code. The list starts with the latest visited location at the top and contains code snippets. To open the Recent Locations popup, press Ctrl+Shift+E. You can also check your recently viewed or changed code using the Recent Locations popup. If you need, you can assign shortcuts to these actions. Press Ctrl+Shift+A and search for the Move Caret Forward a Paragraph with Selection or Move Caret Backward a Paragraph with Selection action. You can also select a text and then move the caret forward or backward to a paragraph. 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. In the Caret Movement section, use the When moving by words and Upon line break options to configure the caret's behavior. In the Settings dialog ( Ctrl+Alt+S), go to Editor | General. You can configure the position of the caret when you use these actions. When you move the caret to the previous word, the caret is placed in the beginning of the current word. To move the caret to the next word or the previous word, press Ctrl+Right or Ctrl+Left.īy default, CLion moves the caret to the end of the current word. You can also configure where the caret should stop when moved by words and on line breaks. You can use different actions to move the caret through code. To navigate between code blocks, press Ctrl+. To move caret between matching code block braces, press Ctrl+Shift+M. To see on what element the caret is currently positioned, press Alt+Q. To highlight a word at the caret you are trying to locate, select Edit | Find | Next Occurrence of the Word at Caret from the main menu. However, you can press the Up and Down arrow keys to achieve the same result.


This action might be helpful if you do not want to scroll through a large file. To find the current caret location in the editor, press Ctrl+M. To navigate to the last edited location, press Ctrl+Shift+Backspace. To navigate forward, press Ctrl+Alt+Right. To navigate backwards, press Ctrl+Alt+Left. For the detailed information on navigating between the editor and tool windows, check the editor basics. You can quickly navigate through code in the editor using different actions and popups.
