Searching in an IntelliJ Project
How to search for keywords and named elements in an IntelliJ Project.
Searching content is used here to describe filtering content, for example, with a keyword. Navigation is used to describe how to get from one AsciiDoc file to a referenced image or another AsciiDoc file. Read more about navigating in Navigating in an IntelliJ Project.
This is part of the step-by-step series to set up a technical writing environment with IntelliJ and the AsciiDoc plugin. See the page Setup for technical writing for an overview of all steps.
Prerequisites
This assumes that IntelliJ IDEA is open with a project with some existing content. See Opening a project in IntelliJ IDEA and Editing an AsciiDoc file in IntelliJ on how to do this.
Searching within an AsciiDoc project
This describes several ways on how to search through the contents of a project, open the right files. Use the menu item Navigate for a full list of options, or use
to search all action available in the IDE.To return to previously edited files, use the following options:
-
To return to a previous file, use Ctrl+E ⌘ E and select the file to return to.
-
Use Alt+Shift+Left Alt+Ctrl+Left ⌘ ⌥ ← and Alt+Shift+Right Alt+Ctrl+Right ⌘ ⌥ → to move backwards and forwards in the latest cursor positions.
-
To return to the previous editing position, use Ctrl+Shift+Backspace ⇧ ⌘ ⌫.
- Search for a text snippet in the current file
-
To search within the current file, use Ctrl+F ⌘ F. This is by default case-insensitive and uses a plain text search. Using the icons at the end of the input field, the use can switch to a case-sensitive search and a search with regular expressions.
If you want to replace instead of searching, you can use Ctrl+R ⌘ R instead.
- Search for a text snippet across all files in a project
-
To search within all files of the project, use Ctrl+Shift+F ⌘ ⇧ F.
This is by default case-insensitive and uses a plain text search. Using the icons at the end of the input field, the use can switch to a case-sensitive search and a search with regular expressions.
Use the menu items In Project, Module, Directory and Scope to limit the search to a specific area.
Move the selection up and down, and use the small editor window to edit the code directly.
If you want to replace instead of searching, you can use Ctrl+Shift+R ⌘ ⇧ R instead.
Use Open in Find Window to open the list of files in a tool window which allows opening each occurrence in an editor and then jump with Ctrl+Alt+Down ⌘ ⌥ ↓ and Ctrl+Alt+Up ⌘ ⌥ ↑ between them.
- Search by File Name
-
To search a file by its name, use Ctrl+Shift+N ⌘ ⇧ O.
Type parts of the path and the file name to restrict the search to the file.
- Search Everywhere
-
A user can search for all named elements in a project. This includes attributes, IDs and section heading. Use 2x Shift 2x ⇧ to open the dialog.
To search for symbols only (which includes the AsciiDoc section headings, attribute names, etc.), jump there directly using Ctrl+Shift+N ⌘ ⇧ N.
Further reading
Read more about keyboard shortcuts in Using Hotkeys.
Continue to Using tables with AsciiDoc in IntelliJ for the next step of this series.