WebStorm 2018.3 Help

Search for a target within a file

You can search for a text string in a currently opened file in the editor. Using different options, you can narrow your search process, use regular expressions in your search, and manage your search results.

To find occurences of a text string

  1. Open your file in the editor.

  2. From the main menu, select Edit | Find | Find (Ctrl+F).

  3. In the search field that opens, enter your search string.

    search string
    WebStorm highlights the results of your search in the file.

To see the usages of a symbol in the current file

  • Place the cursor at this symbol and press Ctrl+F7. WebStorm highlights all the usages of the symbol in the file.

    To turn off this highlighting, in the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General and clear the Highlight usages of element at caret checkbox.

Manage your search

WebStorm lets you adjust your search process and perform various actions with the displayed search results.

  • To see the list of previous searches, press Alt+Down in the search field.

    search history

  • To enter a multi-line string, click the Enter a new line icon in the search field for a new line.

  • To navigate to the previous or to the next occurrence, use the Previous occurence and Next occurence arrows.

  • Work with the list of occurrences (Alt+F7) in the Find tool window, where you have other options, for example, to group your results or to open them in a separate window.

    Found Occurrences in the Find tool window

  • To add a selection of the next occurrence or deselect the previous occurrence, click Add selection for the next occurence or deselect the previous occurrence (Alt+J or Shift+Alt+J).

  • To quickly replace the target of your search in the whole file, press Ctrl+Shift+Alt+J and type the replacement string.

  • To narrow your search, select the Words or Match case checkbox on the search pane, or click filter Filter and select a scope for your search.

  • To quickly select or clear the Regex checkbox, press Alt+X (previously known as Alt+G). Use regular expressions for more challenging searches.

Last modified: 12 December 2018

See Also