Find and replace in a file
Press ⌘F to open Find / Replace at the top right of the editor and find text in the current document. It works in both writing view and source view.
- Press
⌘Fand type the text to find. All matches are highlighted, and the panel shows which match is current and how many matches there are. - Press
Enterto go to the next match and⇧Enterto go to the previous one. - To replace, press
⌥⌘For click Show or hide replace to open the replace field. - Type the new text in the replace field. Press
Enterto replace the current match; click Replace all or press⌘Enterto replace all matches.

Options
- Match case: distinguishes uppercase and lowercase letters.
- Whole word: finds whole words only. A CJK character and the character next to it are treated as separated by a word boundary.
- Regular expression: searches with a regular expression. If the expression has an error, the panel shows where.
Notes
- A replacement is a single edit; press
⌘Zto undo it. - In writing view, matching uses the text shown on screen, without Markdown markup.
- If there are more than 2,000 matches, nothing is replaced; narrow the search.
- In sectioned files over 32 MiB, find also searches the whole file, and Previous match and Next match load the section containing the match. If Replace all affects content outside the current section, it cannot be undone, and the panel shows “Cannot be undone”.