Finding and Replacing Text in File
JetBrains Rider lets you find and replace text strings in an active editor.
Search through the current file
- From the main menu, choose Edit | Find | Find, or press Ctrl+F. The search pane appears on 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 cursor position is selected; the other occurrences are highlighted in the editor. In addition, the matching occurrences are marked in the right gutter with stripes.
- To search for a multi-line fragment, click in the search box.
- Explore the search results.
Replace in the current file
- From the main menu, choose Edit | Find | Replace, or press Ctrl+H. 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 pop-up dialog box opens at the first occurrence, suggesting to replace the current occurrence, or all of them, with an empty string.
- Start typing the replacing string.
- Explore the search results, and, using the buttons of the replace dialog box, replace occurrences as required. See Search and replace options below.
Working with search results
- To initiate a new search, do one of the following (depending on the current focus):
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:
- The search pane shows the number of found occurrences. If no matches are found, the search pane becomes red:
- Use the recent search history: with the search pane already open, click to show the list of recent entries.
- Use Code completion in the Find and Replace panes. Start typing a search string, press Ctrl+Space, and select the appropriate word from the suggestion list.
- With the Find and Replace pane already opened, use Ctrl+H or Ctrl+F to toggle between panes. Thus, the search and replace strings are preserved.
- To cancel the operation and close the pane, press Escape.
- Use multiple selection (multiselection). For example, if a certain string has been highlighted as a search result, it is possible to add an occurrence of this string to multiple selection by clicking (Alt+J), delete an occurrence from multiple selection using (Shift+Alt+J), or add all found occurrences to multiple selection using (Ctrl+Shift+Alt+J).