Find and replace in a note

Last updated

Find searches the note that is currently open. To search across every note instead, use the Search tab in the sidebar.

Find and replace is available in the web app and the desktop app.

Opening find

Press Cmd/Ctrl+F to open the find bar above the editor, or Cmd/Ctrl+Alt+F to open it with the replace row already expanded. Settings → Keyboard Shortcuts lists every shortcut in the app.

The two shortcuts control two different things, and both toggle:

  • Cmd/Ctrl+F controls the bar itself. Press it again to close find, whether or not the replace row is showing.
  • Cmd/Ctrl+Alt+F controls only the replace row. Press it again to put the replace row away and leave find open.

Either way the query input is refocused and its text selected, so you can retype straight away. Escape always closes.

If you are in Preview mode when you open find, Notate switches you to Editor mode first, so there is always something to search and every match is somewhere you can edit. Split mode is left as it is, since it already shows the editor.

Switching to Preview while find is open closes the bar, since Preview has no editor for it to search.

Moving between matches

Every match in the note is highlighted, and the current one is highlighted more strongly. The counter beside the input shows where you are, so 3/12 means the third of twelve matches.

  • Enter jumps to the next match, Shift+Enter to the previous one.
  • The up and down arrows in the bar do the same thing.
  • Navigation wraps, so going past the last match returns you to the first.
  • Escape closes the bar and leaves your cursor on the current match.

Notes with a very large number of matches stop counting at 5000, shown as 5000+.

Narrowing what counts as a match

Two toggles sit at the right of the find bar.

  • Aa makes the search case-sensitive, so Cat no longer matches cat.
  • ab restricts matches to whole words, so cat matches cat but not concatenate.

Frontmatter

If a note starts with a frontmatter block and you have properties set to show as a panel, that block is hidden in the editor, and find skips it. Counting matches you cannot see would leave the counter disagreeing with the highlights on screen.

Use the frontmatter toggle in the row above the text to show the block as source, and find will search it along with the rest of the note.

Replacing

Expand the replace row with the chevron at the left of the bar, or open find with Cmd/Ctrl+Alt+F.

  • Replace swaps the current match and moves to the next one.
  • All swaps every match in the note at once.

Replace All counts as a single edit, so one undo puts the whole note back the way it was.