Project Find and Replace
To find in every file of a project, choose File ⟩ Find in Project… (shift command F) or click the Find button in the toolbar. The sidebar changes to show the search. Click Back in the toolbar to return to your files.
Type what you are looking for and press enter. The results are listed in the sidebar, file by file. Click a file to see its first result in the editor, or open the arrow beside its name to see every result in it.
Where to look
The Find heading at the top of the search is a menu that says where to look:
- in Project: every file of the project
- in Workspace: only the files you have open in the Workspace
- in Folder…: one folder of your choosing
Choose File Names… from the same menu to keep the search to files with certain names, or to leave some out. There are two fields: Only in and Not in. In each, write one or more patterns separated by commas, where * stands for any run of characters and ? for any one character:
*.css, *.scssmatches files by name, wherever they areassets/*.jshas a slash in it, so it is a path from the folder being searchedvendor/libnames a folder, and covers everything inside itbuild/ends in a slash, and matches folders only
For example, to search your own stylesheets but not those of a library, look only in *.css and not in vendor/.
Search options
By default, searches are for the literal text, ignoring case. Two menus under the search field change that:
- Text or Regular Expression (more information here about Espresso's regular expressions)
- Ignoring Case or Matching Case
Replacing
Enter the replacement in the replace field and click Replace All to replace every result. To replace only some of them, select those files or results in the list first (you can also select a folder to replace everything in the files inside it), and the button replaces just your selection.
Espresso asks before it replaces, and asks what to do with the files it changes that are not open:
- Add documents to the Workspace opens each changed file, unsaved, so that you can look over the changes, and undo them
- Save documents immediately saves the changes without opening the files. These changes cannot be undone.