MCPcopy Index your code
hub / github.com/MahmoudFawzyKhalil/obsidian-global-search-and-replace

github.com/MahmoudFawzyKhalil/obsidian-global-search-and-replace @0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.5.0 ↗ · + Follow
71 symbols 128 edges 25 files 0 documented · 0% updated 2y ago0.5.0 · 2024-06-03★ 10911 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Global Search and Replace for Obsidian

Obsidian Downloads Version

A plugin to do a global search and replace in all of your Obsidian vault files.

showcase

Features

  • Search all of your vault's markdown files for a match
  • Regex support
  • Case-sensitive search support
  • Replace match Enter or click
  • Open note at match Ctrl+Enter on Windows/Linux, Cmd+Enter on 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

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 25
Function 22
Class 12
Interface 12

Languages

TypeScript100%

Modules by API surface

src/domain/file-operator.ts12 symbols
src/main.ts8 symbols
src/obsidian-components/search-and-replace-modal.tsx7 symbols
src/domain/search-result.ts6 symbols
src/react-components/SearchAndReplace.tsx5 symbols
src/settings/settings-tab.ts4 symbols
src/react-components/SearchResultsContainer.tsx4 symbols
src/util/utils.ts2 symbols
src/react-components/use-scroll-selected-search-result-into-view.ts2 symbols
src/react-components/SearchResultDisplay.tsx2 symbols
src/react-components/SearchInput.tsx2 symbols
src/react-components/ResultsNumberSummary.tsx2 symbols

For agents

$ claude mcp add obsidian-global-search-and-replace \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page