Skip to main content

Search and Replace

Plugin alias: searchreplace

editor42.init({
plugins: 'searchreplace'
});

Provides find-and-replace functionality through a dialog that supports case-sensitive matching, whole-word matching, and search-within-selection. Matches are highlighted with the class editor42-m-match-marker, with the active match additionally receiving editor42-m-match-marker-selected.

Commands

CommandDescription
SearchReplaceOpens the Find and Replace dialog.

Toolbar buttons

ButtonTypeDescription
searchreplaceButtonOpens the Find and Replace dialog.
ItemDescription
searchreplaceOpens the Find and Replace dialog.

API

MethodDescription
find(text, matchCase, wholeWord, inSelection?)Finds and marks matches, returns count.
next()Moves to next match.
prev()Moves to previous match.
replace(text, forward?, all?)Replaces current or all matches.
done(keepEditorSelection?)Removes all markers, resets state.

Keyboard shortcuts

ShortcutAction
Ctrl+F / Cmd+FOpens the Find and Replace dialog.