
I made a plugin that helps do batch search/replace in the form of preset commands!
I often need to do a whole bunch of small replace actions across a ton of content; so I went and made an Obsidian plugin that lets you set up series of replace actions using plain text or regex that you can use in the right-click menu!
It's meant to be as intuitive as possible, with live previews in the editor (especially useful when using regex), and either affects the whole page, or currently selected text to avoid messy mistakes. You can even Ctrl+Z undo things if you made a mistake.
Features
- Custom Actions:
- Create named actions (e.g., "Clean OCR", "Format Tables") that contain one or more search/replace rules.
- Live Preview Test Bench:
- Instantly test your rules in settings using a real-time preview. Each rule shows its step-by-step intermediate output before giving the final result.
- Sequential Processing & Reordering:
- Chain multiple rules perfectly and easily rearrange their execution order directly in the UI.
- Smart Targeting:
- If you highlight text, the action only applies to your selection. If nothing is selected, it applies to the entire document.
- Single-Step Undo:
- No matter how many rules are in your action, they are applied as a single atomic transaction. One press of
Ctrl+Zundoes the entire operation. - Regex & Capture Groups:
- Full support for JavaScript Regular Expressions. Use capture groups (e.g.,
$1,$2) in your replacement strings. - Custom Regex Flags:
- Easily add flags like
i(case-insensitive) orm(multiline) to your regex rules. - Plaintext Escapes:
- If you turn regex off, you can still search for
\n(newlines) and\t(tabs) in plaintext mode. - Easy Access:
- Run your actions directly from the Obsidian Command Palette (
Ctrl/Cmd + P), or add them to the right-click Editor Context Menu.
Just look for Replace Commands in the Communi Plugins settings menu; or check out the Obsidian Community listing.