Source code navigation
You can quickly navigate through code in the editor using different actions and popups.
Find a file path
In the editor, press Ctrl+Alt+F12 or in the context menu, select Reveal in Finder.
In the Reveal in Finder popup, select a file or a directory to open in a path finder and press Enter.
Navigate with the Select In popup
You can automatically locate a file in the Files tool window.
If the file is opened in the editor, press Alt+F1 to open the Select In popup.
In the popup, select Files View and press Enter. DataGrip locates your target in the Files tool window.
Use Autoscroll to locate a file
You can use the Autoscroll to Source and Autoscroll from Source actions to locate your file in the Files tool window.
In the Files tool window, right-click the Files toolbar and from the context menu select Autoscroll from Source. After that DataGrip will track the file that is currently opened in the active editor tab and locate it in the Files tool window automatically.
You can also select the Autoscroll to Source option. In this case, when you click a file in the Project view, DataGrip will automatically open it in the editor.
Use bookmarks for navigation
To create an anonymous bookmark, place the caret on the needed code line and press F11.
To create a bookmark with mnemonics, place the caret on the needed code line, press Ctrl+F11 and select a number or a letter for the mnemonics.
To open the Bookmarks dialog, press Shift+F11. You can use this dialog to manage bookmarks, for example, delete, sort bookmarks, or supply them with a brief description.
To navigate to an existing bookmark with letter mnemonics, press Shift+F11 and then press a letter you need. DataGrip returns you to the editor and to the corresponding bookmark.
To navigate to an existing bookmark with number mnemonics, press Ctrl and the bookmark's number.
Every created bookmark is reflected in the Favorites (N/A) tool window which you can also use for navigation to your bookmarks.
Locate a code element with the Structure view popup
You can use the structure view popup to locate a code element in the file you are working on.
To open the structure view popup, press Ctrl+F12.
- In the popup, locate an item you need. You can start typing a name of the element for DataGrip to narrow down the search. Press Enter to return to the editor and the corresponding element.
While in the popup, you can sort file members, see anonymous classes and inherited members.
Find a line or a column
In the Go to Line/Column dialog, specify a line or column number, or both, separating them with: and click OK.
If you don't want to see the line numbers in the editor, in the Settings/Preferences dialog (Ctrl+Alt+S), go to and clear the Show line numbers checkbox.
Find the caret, edited line, or edited location
To find the current caret location in the editor, press Up and Down arrow keys.
To highlight a word at the caret you are trying to locate, selectfrom the main menu.
To see on what element the caret is currently positioned, press Alt+Q.
To see the previous caret position, press Ctrl+Alt+Left. To move forward, press Ctrl+Alt+Right.
- 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.
You can also select a text and then move the caret forward or backward to a paragraph. Press Ctrl+Shift+A and search for the Move Caret Forward a Paragraph with Selection or Move Caret Backward a Paragraph with Selection action.If you need, you can assign shortcuts to these actions. Refer to Configuring keyboard shortcuts for details.
To toggle between the starting and ending code block braces, press Ctrl+Shift+M.
To navigate to the last edited location, press Ctrl+Shift+Backspace.
Find recent files
You can search for the recent and recently edited files with the Recent Files popup.
To open the Recent Files popup with the list of recent files, press Ctrl+E.
To see only the recently edited files, press Ctrl+E again or select the Show changed only checkbox.
To search for items in the popup, start typing the search query. DataGrip displays the results based on your search.
Find recent locations
You can check your recently visited or changed code locations using the Recent Locations popup.
To open the Recent Locations popup, press N/A. The list starts with the latest visited location at the top and contains code snippets.
While in the popup, use the same shortcut or select the Show changed only checkbox to see only the locations with changed code.
To search for a code snippet, in the Recent Locations popup, start typing your search query. You can search by the code text, filename, or breadcrumbs.
To delete a location entry from the search results, press either Delete or Backspace.
Keep in mind that the deleted location is also removed from the list of entries that you access with the Ctrl+Alt+Left shortcut.
Navigation in the SQL code and files
Go from a reference to a definition
To go to the definition of a column, table or any other object, select the object name in code and navigate to(Ctrl+B). Alternatively, press Ctrl (Windows) or Cmd (MacOS) and click a reference.
Go from a reference to a DDL definition
In the Setting / Preferences dialog (Ctrl+Alt+S), navigate to Database | General.
In the Navigation pane, clear the Prefer database view over DDL editor checkbox.
Switch between different definition views
Place a caret over the object and press Alt+F1.
Select the desired view from the context menu.
Switch between files using the switcher
With the switcher, you can switch between open files, consoles, and tool windows.
To open the Switcher window, press Ctrl+Tab. Do not release the Ctrl key. Use arrow keys to move in the Switcher window. When you release the Ctrl key, the selected item becomes active, and the switcher closes.