Global Search and Replace
approvedby Mahmoud Fawzy Khalil
Search and replace in all vault files.
Global Search and Replace for Obsidian
A plugin to do a global search and replace in all of your Obsidian vault files.

Features
- Search all of your vault's markdown files for a match
- Regex support
- Case-sensitive search support
- Replace match
Enterorclick - Open note at match
Ctrl+Enteron Windows/Linux,Cmd+Enteron Mac - Cycle through matches using arrow keys
Installation
Through Obsidian community plugin browser
This plugin is available through obsidian's official plugin marketplace.
Manual
Download a release's main.js, styles.css, and manifest.json files and install it by pasting the files into the VAULT_PATH/.obsidian/plugins/global-search-and-replace folder (enable viewing hidden folders to be able to see the .obsidian folder!)
Usage
Use the command palette and activate the Global Search and Replace: Search and Replace in all files command.
Specifying a string as the replacement
The replacement string can include the following special replacement patterns:
| Pattern | Inserts |
|---|---|
$$ | Inserts a "$". |
$& | Inserts the matched substring. |
$` | Inserts the portion of the string that precedes the matched substring. |
$' | Inserts the portion of the string that follows the matched substring. |
$n | Inserts the nth (1-indexed) capturing group where n is a positive integer less than 100. |
$<Name> | Inserts the named capturing group where Name is the group name. |
$n and $<Name> are only available if the pattern argument is a RegExp object. If the pattern is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string.
JSCopy to Clipboard
"foo" replace /(f)/,"$2"
// "$2oo"; the regex doesn't have the second group
"foo" replace "f","$1"
// "$1oo"; the pattern is a string, so it doesn't have any groups
"foo" replace /(f)|(g)/,"$2"
// "oo"; the second group exists but isn't matched
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.