Finding and replacing text in your file or project is quick and easy in Atom.
If you launch either of those commands, you'll be greeted with the Find and Replace panel at the bottom of your screen.
To search within your current file you can press Cmd+FCtrl+F, type in a search string and press Enter (or Cmd+GF3 or the "Find Next" button) multiple times to cycle through all the matches in that file. The Find and Replace panel also contains buttons for toggling case sensitivity, performing regular expression matching and scoping the search to selections.
If you type a string in the replacement text box, you can replace matches with a different string. For example, if you wanted to replace every instance of the string "Scott" with the string "Dragon", you would enter those values in the two text boxes and press the "Replace All" button to perform the replacements.
Note: With a regular expression search, the replacement syntax to refer back to search groups is $1, $2, … $&
You can also find and replace throughout your entire project if you invoke the panel with Cmd+Shift+FCtrl+Shift+F.
This is a great way to find out where in your project a function is called, an anchor is linked to or a specific misspelling is located. Click on the matching line to jump to that location in that file.
You can limit a search to a subset of the files in your project by entering a glob pattern into the "File/Directory pattern" text box. For example, the pattern
src directory. The "globstar" pattern (
**) can be used to match arbitrarily many subdirectories. For example,
docs/**/*.md will match
When you have multiple project folders open, this feature can also be used to search in only one of those folders. For example, if you had the folders
/path2/folder2 open, you could enter a pattern starting with
folder1 to search only in the first folder.
Press Esc while focused on the Find and Replace panel to clear the pane from your workspace.