Search

Search and replace text in every file of the session's folder, open a file by name, and find and replace in the open file.

Search looks for text in every file of the session's folder, takes you to the line where it is and replaces the text in several files at once. This page also shows how to open a file by name and how to search only the open file. To find a file, a symbol or an action in one list, see Search Everywhere.

Search the files

Open Search from its icon, in the tool bar on the session's right edge, or with ⌘ ⇧ F, which puts the cursor in the Search all files field. The search starts at 2 characters, as soon as you stop typing.

Beside the field are Match case, Whole word and Regular expression. Results come grouped by file, with the folder, how many times the text appears and each line with the match highlighted; the summary says, for example, "12 results in 3 files". A click on a line opens the file in the Code panel, at that line.

What is left out

The search skips what git ignores and what an .ignore file lists, the .git folder, the Hide files patterns (Hide files), files over 2 MB and binary files. Files and folders whose names start with a dot are searched, as long as git does not ignore them.

It stops at 2,000 results, and the summary says "partial list". In each line, the search only looks at the first 300 characters. An invalid regular expression shows the error in place of the summary.

Replace in files

The button to the left of the field, Show the replace row, opens the Replace with field. The Replace in Files key opens it too: ⌃ ⇧ R in WebStorm, ⌘ ⇧ R in WebStorm (macOS) and ⌘ ⇧ H in VS Code. From the key, with a one-line selection in the code, the selected text goes into the search. In WebStorm (macOS), ⌘ ⇧ R only replaces with the cursor in the code; outside it, it is still Restore all.

Each row of the list shows the old text struck through and the new one beside it; in a regular expression search, $1 and ${name} already show replaced. On each file, Replace in this file replaces only there, and Remove from the list leaves the file out. Replace all asks first, with how many occurrences and files will change, and is off when the list was cut short: "Too many results; narrow the search". While a new search runs, the previous list stays on screen, and the buttons wait for the new one.

An open tab gets the replacement in its own text, with undo. A closed file is written after it goes into the local history. A file that changed after the search is left out, and the notice names it.

Open a file by name

Open file finds a file in the session's folder by name and opens it in the editor. Outside the code, use ⌘ P in every keymap. With the cursor in the code, use your keymap's key: ⌘ ⇧ N in WebStorm, ⌘ ⇧ O in WebStorm (macOS) and ⌘ P in VS Code; in the WebStorm keymaps, ⌘ P there shows the parameters.

Just type the name's letters in order, without them needing to be together; a match on the file's name ranks above a match on its folder only. The arrows choose, ↵ opens, and Esc closes. The list shows up to 50 files and leaves out what git ignores, .git and the Hide files patterns. In a folder with more than 20,000 files, it says the list is partial.

Search the open file

With the cursor in the code, ⌘ F opens Find at the top of the editor, in every keymap. Replace is ⌘ R in the WebStorm keymaps and ⌥ ⌘ F in VS Code. With the cursor in the field, F3 and ⌘ G go to the next match, and with ⇧ to the previous one, in every keymap; Esc closes it.

Back in the text, Find Next follows the keymap: F3 or ⌃ L in WebStorm, ⌘ G in WebStorm (macOS) and ⌘ G or F3 in VS Code, and with ⇧ the previous one. In WebStorm (macOS), F3 toggles a bookmark, as in WebStorm. With no search made, the key opens Find.

Keys

Action Key
Search all files ⌘ ⇧ F, anywhere; in WebStorm, outside the terminal, also ⌃ ⇧ F
Open a file by name ⌘ P outside the code, or the keymap's key in the code
Find in the file ⌘ F
Replace in files ⌃ ⇧ R (WebStorm), ⌘ ⇧ R in the code (WebStorm (macOS)) or ⌘ ⇧ H (VS Code)
Replace in the file ⌘ R (WebStorm) or ⌥ ⌘ F (VS Code)

On Windows and Linux, which are in preview, use Ctrl instead of ⌘; in the VS Code keymap, Replace is Ctrl H. Replace in Files is Ctrl Shift R in the WebStorm keymaps, only with the cursor in the code (outside it, the key is Restore all), and Ctrl Shift H in VS Code. In the WebStorm keymaps, Find Next is F3 or Ctrl L.

Plan and limits

Search, replacing in files, Open file and searching the open file are on the free plan.

Search looks only inside the session's folder, never in other sessions or workspaces. It reads plain text: a file that is not UTF-8 is left out.