shechu-ovo-10127 downloadsShow search results grouped under their headings, in find in note and in the built-in search, and still find words split by line breaks, tags or page markers.
Search results grouped under their headings, in find in note and in Obsidian's built-in search. 简体中文
This plugin improves how Obsidian shows search results, in two places:
Ctrl+F (taking it over is optional) for a floating panel that lists every match under its headings, which fold; click one and the note jumps to it and highlights it. Obsidian's own Ctrl+F marks one match at a time, and you step through them with the arrows. The panel switches between tree and compact (one line per match).path: operator. The enhancement brings three things: results grouped under headings; words split by a line break, a <!--p.12--> page marker, a tag or a comment are still found; and variant characters such as 鄴 and 邺 count as the same (used for searching only; your notes are never changed).Variants and page markers are mainly for people who read Chinese historical texts; you can ignore them otherwise. If your notes mark pages like <!--p.12-->, the find-in-note panel shows each result's page number (see "Page markers" below).
An independent plugin, not affiliated with Better Search Views (see Acknowledgements).
No network access, no telemetry, no account; works on desktop and mobile. The interface follows Obsidian's language (Chinese, or English otherwise). In the English interface the variant-character features are hidden by default (turn them on in settings if you read Chinese sources). A short feature guide opens the first time the plugin is enabled; reopen it any time with the command "Show feature guide".
Real screenshots of the same notes and the same search word.
Top: Obsidian's own Ctrl+F, which marks one match at a time. Bottom: this plugin's find in note, with every match under its headings, so you see the whole note at a glance and click to jump.

In each pair, left: Obsidian's own search; right: with the "Enhance Obsidian search" setting on (the default). Put a phrase in quotes so Obsidian treats it as one phrase.
Results grouped by heading. Search for "treaty". Obsidian lists the results flat; with the enhancement they sit under their headings, and each heading folds.

Words split by a page marker. Search for "treaty was signed in Paris". The enhancement also finds the one split by a line break and a <!--p.22--> page marker.

Commands in the command palette:
Ctrl+F, this still opens the built-in find bar (with replace).Everything is on one page: custom variant groups (one group per line, such as 於于), the three Unicode Unihan tables (traditional and simplified, Z-variants, semantic variants), the maximum number of results, whether find in note takes over Ctrl+F, and the position and size of the panel.
If your notes are transcriptions of old books or edited texts, write an HTML comment where page N begins: <!--p.N-->, with N an integer (it may be negative when the front matter has no printed page number, as in <!--p.-3-->). Spaces inside the comment are fine, as in <!-- p.12 -->.
[p.12], <p12> and 第12页 are not.The setting "Enhance Obsidian search" is on by default and can be switched off at any time. While it is on, Obsidian's built-in Search changes in two ways:
How it works:
path:, tag:, file: and line:, your own /regular expressions/, [properties], OR, parentheses and the exclusion sign - are kept as typed; the panel says that these are not affected by the options.> cannot be skipped here).Limits to know about:
The tree view follows the idea of Better Search Views by ivan-lednev (MIT), which shows Obsidian's own search results as an outline of heading breadcrumbs. This plugin does not use its code and draws its own find-in-note panel. The enhancement reads and modifies the built-in search panel only while the setting is on (it is on by default); backlinks and embedded queries are not touched.
The Unihan variant tables are generated from the Unicode Character Database (Unihan, Unicode License v3); see THIRD_PARTY_NOTICES.txt. The plugin is released under the MIT licence.
npm install
npm run build # produces dist/main.js, dist/styles.css, dist/manifest.json
npm test
npx eslint src # the official Obsidian review rules
npm run unihan -- <Unihan.zip> # regenerate the Unihan tables