Finding and replacing words in a document
Find looks for words on the page as you read them, and Replace changes them one match at a time or all at once. Find in folder searches the text of every document in your folders and opens the one you pick at its match.
Finding on the page
To find a word, press CtrlF⌘F. A field opens in the middle of the top bar, in place of its controls. If you had a few words selected, they're already in the field, picked, so you may search for them or type over them.
As you type, every match is marked with a soft highlighter stroke, and the current one with a full one. The field says where you are, 3 of 12, or No matches when there are none.
Press Return or ↓ to go to the next match, and ShiftReturn or ↑ for the previous one. The search wraps round at either end, and the page scrolls to keep the current match in view. CtrlG⌘G and CtrlShiftG⇧⌘G do the same from the page, while the matches show.
When you're done, press Esc. The field closes and the caret lands on the current match, selected, so you can carry on writing right there.
How Find matches
Find has no options to set. Instead, it follows a few simple rules:
- A search in lowercase finds any case, and a search with a capital finds only that case. For example, harbour finds Harbour too, while Harbour doesn't find harbour. This works in every script, Cyrillic included.
- Find searches the text as it reads. Bold, italic and links don't get in the way, and a link's address isn't searched.
- Find searches the version shown of each word, sentence or paragraph that has versions, and your maybes too.
The versions not shown are counted but never gone to. When they hold matches, the field says so after the count: 3 of 12 · 2 in other versions. You can learn more about versions in Versions of a word, a sentence or a paragraph.
While the field is open, you may still type on the page. The matches follow your edits.
Replacing
To replace words, press CtrlH⌥⌘F. Find opens with a second field under it, Replace with, and two words beside it: Replace and All.
Replace changes the current match and goes to the next one, so you may check each one as you go. All changes every match at once. In the Replace with field, Return is Replace and CtrlReturn⌘Return is All. Press Tab or ShiftTab to move between the two fields.
Each Replace is one undo step, and so is All. Before each All in a document saved to a file, Mayhap keeps a copy of it in its history, so you can always go back. You can learn more about this in History.
What a replacement keeps
A replacement keeps the look of what it replaces. For example, replace a word inside bold text and the new word is bold too. Inside a maybe, the new words stay a maybe.
In a word or a sentence that has versions, only the version shown changes. If a replacement takes away all of that version's text, the version goes, and the next one takes its place on the page.
Finding in Aside
When you're writing in Aside, CtrlF⌘F opens the same field on Aside's title line and searches Aside alone. It follows the same rules, and closes when Aside does.
Finding in every document
Sometimes you may wish to find a word in every document you've written, not just the one open. To do so, press CtrlShiftF⇧⌘F. The list of documents opens under the name, with Find in folder in its search field.
Type what you're looking for. Mayhap searches the text of every document in your documents folder and in the folder of the document open, by the same rules as Find. What it finds comes into the list as it's found, grouped by document, with each match on a line of its own. The field says how many matches there are, in how many documents, such as 5 in 3 documents.
Press Return or click a match, and the document opens in this window at that match, with the find field open on your words. Press CtrlReturn⌘Return, or hold Ctrl⌘ while you click, to open it in a window of its own.
Keys
| Command | |
|---|---|
| Find | CtrlF⌘F |
| Replace | CtrlH⌥⌘F |
| Find next | Return, ↓, CtrlG, F3Return, ↓, ⌘G |
| Find previous | ShiftReturn, ↑, CtrlShiftG, ShiftF3ShiftReturn, ↑, ⇧⌘G |
| Replace all | CtrlReturn⌘Return |
| Other field | Tab, ShiftTabTab, ShiftTab |
| Close | EscEsc |
| Find in folder | CtrlShiftF⇧⌘F |