Find and replace text in a file
Edit | Find | Find Ctrl0F
Edit | Find | Replace Ctrl0H
You can quickly find and replace text strings in the current document. Using different options, you can narrow your search process, use regular expressions in your search, and manage your search results.
tip
If you are looking for types, members, files, actions, or settings, use Search Everywhere (Ctrl0T or Shift twice).
Press Ctrl0F or choose Edit | Find | Find from the main menu. The search pane appears at the top of the active editor.
If necessary, specify the search options.
In the search field, start typing the search string:
As you type, the first occurrence of the search string after the current caret position is selected; the other occurrences are highlighted in the editor. In addition, the matching occurrences are marked in the scrollbar with stripes.
To search for a multi-line fragment, click
in the search field or press CtrlShiftEnter
To return to a single-line mode, press Backspace.
To search for symbols declared or used in the current document, start typing a symbol name or its Camel-Cased abbreviation, and then press CtrlSpace to choose from the matched items.
![JetBrains Rider: Looking for symbols from the search field (Ctrl+F) JetBrains Rider: Looking for symbols from the search field (Ctrl+F)](https://resources.jetbrains.com/help/img/rider/2024.3/completion_in_text_search.png)
Press Ctrl0H or choose Edit | Find | Replace from the main menu. The search and replace pane appears on top of the active editor.
If necessary, specify the search and replace options.
In the search field, start typing the search string. As you type, the matching occurrences are highlighted in the editor, and a Replace popup dialog opens at the first occurrence, suggesting to replace the current occurrence, or all of them, with an empty string.
Type the replacement string.
Click Replace All to replace all matching occurrences or Replace to replace items one by one.
Alternatively, you can click Exclude to skip the current occurrence and exclude it from the Replace all operation. The button for this occurrence changes to Include. Use
ShiftF3 and
F3 to move focus to other occurrences that you want to exclude or include.
To initiate a new search, do one of the following (depending on the current focus):
If the editor has the focus, press Ctrl0F.
If the search field has the focus, press Ctrl0A
In both cases, the existing search string will be selected, and you can start typing a new one.
To jump between occurrences, do one of the following:
Press ShiftF3 (jump to previous selection) or F3 (jump to next selection).
Use the
or
buttons in the Search pane.
Click the gutter stripes.
Next to the search field, you will see the total number of found occurrences and the number of the selected occurrence.
You can click
or press Alt0↓ to show the list of recent search entries.
Use Code completion in the Find and Replace panes. Start typing a search string, press CtrlSpace, and select the appropriate word from the suggestion list.
With the Find and Replace pane already opened, use Ctrl0H or Ctrl0F to toggle between panes. Thus, the search and replace strings are preserved.
To close the search pane and switch the focus to the editor, press Esc.
When you press Esc and return the focus to the editor, the first search match stays selected, so you can copy Ctrl0C or cut Ctrl0X it, or start typing to replace the selection.
You can also add multiple carets and selection ranges to the occurrences of the search string — click
AltShift0. and
AltShift0, to select or unselect occurrences one by one, or click
AltShift0; to select all occurrences.
| Show the history of the recent entries. |
Clear the search field. | |
| Enable entering the search string in several lines. Even without this option, you can search for multiline matches with regular expressions and escape characters. |
| Distinguish between upper and lowercase letters while searching. |
| Search for whole words only, that is, for character strings separated with spaces, tabs, punctuation, or special characters. This option is unavailable if Regular expressions is selected. |
| Process the search query as a regular expression. |
| Navigate through the occurrences of the search string. |
| Show search results in the Find window. |
| Add the next found occurrence to a multiple selection. |
| Remove the found occurrence from a multiple selection. |
| Create a multiple selection that contains all the found occurrences. |
Confine search and replacement to the current selection in the editor. | |
| Invoke the list of additional options, for example to confine the search to comments or string literals. |
| When replacing strings, use the casing of each occurrence for replacements. For example, when replacing This option is unavailable if Regular expressions is selected. |