Docs › Writing helpers
Find and replace
Ctrl+F to find in the content, Ctrl+H to replace.
Find words in a long post, or replace them all at once. Inside the editor, Ctrl+F opens find and Ctrl+H adds the replace row. A find bar opens at the top of the editor instead of the browser's page search.
Try it
Click into the editor, press Ctrl+F and look for editor. Ctrl+H opens the replace row as well.
82editor is a free editor. One editor for your board and your blog.
- The word editor in a list is found too
Code for this demo
createEditor('#editor', {
toolbar: 'findReplace | undo redo',
});How it works
- Open it with text selected (one line, under 100 characters) and that text is the search.
- All matches are painted, the current one stronger, with a count like
3/7. It starts at the first match after the caret. - In the find box Enter is next and Shift+Enter previous. In the replace box Enter replaces the current match. Esc closes.
- Match case tells upper and lower case apart.
- Replace all is one undo step.
- A match never spans paragraphs; within one it may cross formatting such as bold.
The toolbar item is findReplace. In the board and full presets it is in the ⋯ more menu; the shortcuts work without it. Find works in read-only mode, replace does not.
From code
editor.exec('findReplace'); // find
editor.exec('replace'); // with the replace rowOptions
| Name | Type | Default | Description |
|---|---|---|---|
findReplace | toolbar item | — | Open the find and replace bar |
| Ctrl+F / Ctrl+H | shortcut | — | Find / replace (⌘ on macOS) |