Native Search Replace

by humoumou
5
4
3
2
1
Score: 50/100

Description

Add replacement controls to Obsidian native Search results.

Reviews

No reviews yet.

Stats

0
stars
89
downloads
0
forks
39
days
39
days
39
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
4
commits

Latest Version

a month ago

Changelog

Changelog

0.2.3

  • Add a deterministic build script and run it in CI so release assets can be reproduced from the checked-in source.

0.2.2

  • Remove the manifest naming violation, avoid the broad :has selector, and add a lockfile for reproducible dependency checks.

0.2.1

  • Clarify installation and usage.
  • Publish release assets from a workflow with GitHub artifact attestations.

0.2.0

  • Integrate replacement actions with Obsidian's native Search result model.

README file from

Github

Native Search Replace

Replacement controls integrated into Obsidian's built-in Search tab.

Installation

Download main.js, manifest.json, and styles.css from the matching GitHub release. Place them in <vault>/.obsidian/plugins/native-search-replace/, reload Obsidian, and enable Native Search Replace under Settings → Community plugins.

Usage

Open Obsidian's built-in Search tab and run a search. Use the per-file or per-match replace controls that appear on the native result rows, or run Native Search Replace: Preview replace all in native Search results from the command palette before applying a bulk replacement.

v0.2.0 — native result-model integration

This version replaces the fragile DOM-to-file inference used in v0.1.x.

  • Gets result files directly from Obsidian SearchView's native result items (view.dom.vChildren._children[*].file).
  • Per-file and per-match actions keep the exact native result item instead of guessing from a displayed filename.
  • Exact quoted searches such as "foo bar" are treated as one simple literal target, so the duplicate Find target row stays hidden.
  • Simple regex and single-token searches also infer their replacement target automatically.
  • Case sensitivity follows the native Search Aa state; the plugin no longer owns a second case-sensitive setting.
  • Complex Search DSL still gets an explicit Find target row because the target cannot be inferred safely.
  • No result-tree MutationObserver and no full result scan on Search open. Result action buttons are added lazily on hover/focus.
  • Writes still use Vault.process() and recompute against current file contents immediately before saving.

Why internal SearchView data is used

Obsidian does not expose a public extension API for attaching replace operations to the core Search result model. Reading the SearchView result items is more reliable than parsing truncated DOM labels and is the same class of integration used by established Search-enhancement plugins.

Manual install

Copy into <vault>/.obsidian/plugins/native-search-replace/:

  • manifest.json
  • main.js
  • styles.css

Then reload Obsidian and enable Native Search Replace.

Privacy and license

Native Search Replace makes no network requests, uses no telemetry, and reads and writes only vault files through Obsidian's vault API. It is released under the MIT License.