Chapter 15

Search and replace across a folder

  1. Open the folder.
  2. Choose the Search sidebar (⇧⌘F by default).
  3. Choose Folder scope.
  4. Enter the search term and optional Match Case, Whole Word, or Regular Expression controls.
  5. Open a result to inspect it in context.

Replace transactionally#

  1. Choose Replace… beside the result count.
  2. Enter the replacement.
  3. Review each affected file, match count, and before/after sample.
  4. Deselect files that should remain unchanged.
  5. Confirm the final match and file count.

Pilcrow skips open files, non-UTF-8 text, and files changed after the preview. This prevents a folder operation from silently overwriting newer work. A replacement affects at most 2,000 files at a time.

Afterward, use the replacement window’s Undo banner to restore the latest batch. A file edited since replacement is left alone. Only the most recent folder replacement has this special backup, so validate before starting another.