Vault Global Replace · Obsidian plugin documentation

Vault Global Replace documentation

Vault Global Replace Obsidian plugin preview

Vault Global Replace finds and replaces text across Markdown notes in an Obsidian vault with an interactive per-file and per-match preview. Inspect every candidate line before writing, uncheck individual files or single occurrences that should stay untouched, and apply your chosen updates atomically through vault.process while keeping untouched text and line endings intact.

Every scan, preview, regular expression check, scope filter, side-by-side diff, saved preset, and batch undo runs locally on your device on both desktop and mobile. Free features need no account and make zero network requests.

Version 1.0.0. Requires Obsidian 1.13.4 or later. Works on desktop and mobile.

1 Installation

Open Settings, then Community plugins, then Browse, and search for "Vault Global Replace". Select Install, then Enable.

To install by hand, download main.js, manifest.json, and styles.css from the latest release. Place the three files in <vault>/.obsidian/plugins/vault-global-replace/. Reload the list of community plugins, then enable Vault Global Replace.

Vault Global Replace requires Obsidian 1.13.4 or newer and runs on both desktop and mobile.

2 Getting started

  1. Run "Find and replace across notes" from the command palette, ribbon icon, or status bar item.
  2. Enter search and replacement text, then toggle Case sensitive or Whole word as needed.
  3. Select Preview matches to scan your Markdown notes without changing any file on disk.
  4. Uncheck any file or individual match you want to skip, then select Apply selected to write updates atomically.
  5. With Pro active, enable Regular expression, Scope filters, or Side-by-side diff, manage saved presets, or run "Undo last batch".

3 Features

Interactive vault-wide find and replace

Search plain text across Markdown files with toggles for case sensitivity and whole-word boundaries. Whole-word matching checks Unicode letter, digit, and underscore boundaries so replacing cat updates standalone words while skipping concatenate or cat_1. Plain-text mode treats dollar signs literally so $100 writes exact text. Free runs preview up to 50 matching files per batch and report when more matches exist.

Per-file and per-match checkboxes with atomic writes

Each matched note shows a file checkbox and one row per match with the 1-based line and column number, matched text, replacement text, and line preview. Uncheck a whole file or exclude one match inside a file while applying the rest. Selecting Apply selected checks that each file has not changed since preview, writes atomically via app.vault.process, and summarizes updated files, replaced matches, and skipped notes.

Regular expressions with capture groups and ReDoS guard (Pro)

Enable regular expression mode across unlimited notes and rewrite matches with numbered capture groups ($1 to $99), named groups ($<name>), full-match tokens ($&), and escaped dollars ($$). Combine searches with scope filters for folder path prefix, #tag (inline and YAML frontmatter tags), and frontmatter property (key or key=value). A static ReDoS guard rejects nested quantifiers such as (a+)+ and overlapping repeated alternations, paired with per-file iteration limits so complex inputs cannot freeze Obsidian.

Side-by-side diff preview (Pro)

Toggle Side-by-side diff in the preview modal to compare original lines on the left against replaced lines on the right with 1-based line numbers. Checking or unchecking individual matches updates the diff right away for that file.

Saved presets and one-click atomic undo (Pro)

Save recurring queries, toggles, and scope filters as named presets in plugin settings for one-click loading. Applied batches push before and after snapshots onto an in-memory undo stack (up to 20 batches) so Undo last batch restores notes atomically through vault.process while skipping any file edited afterward.

4 Commands

Open the command palette and type the plugin name to see these commands. You can give each one a hotkey in Settings, Hotkeys.

Command Command id
Find and replace across notes vault-global-replace:find-and-replace
Regex find and replace across notes vault-global-replace:regex-find-and-replace
Manage saved presets vault-global-replace:manage-presets
Undo last batch vault-global-replace:undo-last-batch

5 Settings

After a minor or major update, this plugin opens one What's new tab in the background. The tab and settings card suggest other NoteMods plugins and Zovo Chat and link to notemods.com for feedback (privacy). The tab sends no data. Turn the tab off in Settings.

Setting Default Allowed values
Default case sensitivity Off On or off.
Default whole-word matching Off On or off.
Diff context lines 1 line 1 line, 3 lines, or 5 lines.
Show status bar shortcut On On or off.

6 Pro

The command "What Pro adds" shows each paid feature with an interactive demo on sample text.

Sponsor $5 a month, or $15 once. When you have paid $15 in total, Pro stays on.

Sponsor through the links above, then sign in from the plugin settings.

7 Privacy, payment and network

The core features are free. Pro features need a GitHub Sponsors sponsorship of theluckystrike: $5 a month or more, or $15 once. A total payment of $15 meets the payment requirement for Pro without further payment. Sign-in and the checks below still apply. Your notes stay readable and editable with or without Pro.

One payment turns on Pro in every NoteMods plugin.

GitHub handles the payment. Sponsor at https://github.com/sponsors/theluckystrike/sponsorships?tier_id=666162&frequency=one-time&metadata_source=vault-global-replace. You need no account for the free features. Pro needs the GitHub account that sponsors.

Until you select "Sign in with GitHub" in the settings, Vault Global Replace makes no network requests. Sign in uses the GitHub device flow. Vault Global Replace sends its public client ID and the scope read:user to https://github.com/login/device/code and shows you a code. While you enter the code at https://github.com/login/device, it asks https://github.com/login/oauth/access_token every few seconds to check the sign-in status. The scope permits profile reads only. GitHub needs this access to show the sponsorship tier. It grants no repository scope and no write access.

After sign in, Vault Global Replace sends one query to https://api.github.com/graphql. It checks if the signed-in account sponsors theluckystrike. It asks for the tier and the total payment to theluckystrike. The plugin reuses a successful check for 7 days. Failed checks can retry after 6 hours. Select Refresh to request an earlier check. It sends no note content, file names or other vault data, and it has no telemetry.

After a successful check, Pro can work offline for up to 14 days. Sign out or a negative sponsorship answer turns Pro off. The plugin stores the GitHub token through the secret storage API of Obsidian. It does not put the token in its saved settings or its local sponsorship data. The local storage of this device keeps your GitHub login, the tier and the time of the last check. Sign out clears the token. You can also revoke the access in your GitHub settings, under Applications.

8 Questions and answers

Does replacing text change line endings or byte order marks?

No. Vault Global Replace splices only the exact character spans of checked matches and preserves LF or CRLF line endings, YAML frontmatter formatting, and leading UTF-8 byte order marks.

What happens if a note changes after Preview matches?

Before writing and inside vault.process, the plugin compares the file against its preview snapshot. Any note modified externally after preview is skipped without writing and reported in the summary.

What happens when more than 50 files match in Free?

Free mode previews the first 50 matching files in path order, reports how many additional files were omitted, and links to Pro for unlimited batches.

How does one-click atomic undo protect manual edits?

When you run "Undo last batch", the plugin checks each note inside vault.process and restores only files whose current text matches the post-batch snapshot, skipping any note edited afterward.

9 Support

Plugin page: vault-global-replace.

Report a bug or ask for a feature in the issue tracker of this repository. Include your Obsidian version and a minimal sample note.

To build from source:

npm ci
npm run build
npm test

10 License

MIT

Vault Global Replace · Obsidian plugin documentation