Use case
- Find and replace: quickly locate words or phrases and replace them.
- Content navigation: jump to the next or previous match without scrolling manually.
- Highlighting: visually emphasize search results for the user.
- Custom workflows: integrate search into toolbars, command palettes, or keyboard shortcuts.
Commands
goToFirstMatch
Navigate to the first search match
Scrolls editor to the first match from previous search
search
Search for string matches in editor content
Returns array of SearchMatch objects with positions and IDs
String | RegExp
required
Search string, regex, or regex shorthand (e.g.,
'/pattern/flags')Object
Optional settings
boolean
default:"true"
Apply CSS highlight classes to matches
number
default:"1000"
Maximum number of matches to return
goToSearchResult
Navigate to a specific search match
Scrolls to match and selects it
SearchMatch
required
Match object to navigate to

