README file from
GithubObsidian Text Finder
This plugin for Obsidian(https://obsidian.md).
Provides a VSCode-like finder: search/replace in editing mode and rendered-text search in reading mode.
Feature
Search or replace the current Markdown file in editing mode, or search its rendered body in reading mode.
- Search/Replace in current file
- Highlight matching text
- Show number of matches
- Supports regular expressions
- Supports case sensitivity
- Input history
To Do
- Search/Replace in Selection
ScreenShot

How to use
Install
Community plugins
- Search for "text finder" in the community plugins and install it.
- Enable plugin in Obsidian setting.
BRAT
- Install the BRAT Plugin
- Execute command
Obsidian42 - BRAT: Add a beta plugin for testing - Paste the URL of this repository and confirm
- Enable plugin in Obsidian setting.
Releases
- Download
main.js,styles.css,manifest.jsonin the latest release - Copy over
main.js,styles.css,manifest.jsonto your vaultVaultFolder/.obsidian/plugins/text-finder/. - Enable plugin in Obsidian setting.
Basic usage
- Assign shortcuts to Text Finder commands in Obsidian's hotkey settings.
- Run “Open search in current file”, enter a query, and use the previous/next buttons or Enter to navigate matches.
- In editing mode, use “Open search & replace in current file” for replacements. Press Escape or the close button to hide the finder.
Reading-mode search
- Run “Open search in current file” in reading mode for case-sensitive search, regex, highlights and match navigation. Replacement is not available.
- Searches rendered body text, not hidden Markdown markers. Embedded notes and some plugin-generated content are not supported.
- If native find still opens after upgrading, disable “Using Obsidian's native search in reading” in settings.
Regular expression replacement
Enable regular expression mode to use capture groups in replacements: for example,
find (foo)(bar) and replace with $2-$1 to produce bar-foo.
- Use
$1,$2, etc. for capture groups,$<name>for named groups,$&for the matched text, and$$for a literal dollar sign. - When the escape-character setting is enabled,
\nand\tin regex replacements become a newline and a tab;\\inserts a literal backslash. - In ordinary text mode, replacement text is literal: dollar templates and backslash escapes are not expanded.
- Zero-width matches, such as
^on its own, are currently excluded from search and replacement.
Split views
- Each finder operates on the Markdown view where it was opened. Split views, including two views of the same file, keep their own current match.
- Opening another file in that view preserves the query and updates the results.
- Editing updates matches without automatically changing your reading position. Replacement is available only in editing mode.
Search history
- Run “Show search history” to view, reuse, copy or delete queries. Use Up/Down in the search field to browse history.
- Leading/trailing spaces, newlines and tabs are preserved. Continuous navigation with the same query counts as one use.
- Keep 1–200 entries and sort by creation time, last use or usage count. Lowering the limit removes lower-priority entries.
- Disabling history preserves existing entries but stops recording new queries, updating usage and Up/Down history navigation.
- Read/save failures display a notice. Follow its instructions; unsaved changes may be lost on exit.
Customize Style
Use CSS snippets or Style Settings Plugin to customize styles.
Example Style Settings configuration file.
Here are some CSS snippets examples.
Match colors (editing and reading modes)
body {
--nya-match-bgColor: #ea5c0054;
--nya-match-color: inherit;
--nya-match-curbgColor: #ffcc00;
--nya-match-curColor: #000000;
}
Match Highlight and Current Item (editing mode)
.nya-text-finder-match {
border-radius: 2px;
box-shadow: 0 0 0 1px rgb(60, 115, 75);
background-color: inherit;
color: inherit;
}
.nya-text-finder-match-current {
box-shadow: 0 0 0 1px rgb(187, 187, 187);
background-color: rgba(255, 170, 0, 0.8);
color: black;
}
Change Position
Top Left
.nya-finder {
right: unset !important;
left: 376px;
}
Bottom Right
.nya-finder {
top: unset !important;
bottom: 72px;
}
Bottom Left
.nya-finder {
top: unset !important;
right: unset !important;
left: 376px;
bottom: 72px;
}
Change the border color when focused
body {
--nya-focus-border-color: #39c5bb;
}
Change the color of the collapse button
.nya-toggle {
border-left: 3px solid red !important;
}
Developer documentation
For source builds, design notes, testing and acceptance, see the developer documentation.