Find and replace in selection

by Dmitry Savosh
5
4
3
2
1
Score: 48/100

Description

Category: Note Enhancements

The Find and replace in selection plugin enhances text editing in Obsidian by allowing users to perform search-and-replace operations within a specific selection of text. This plugin supports both plain text and regular expressions for flexible pattern matching and replacement. Users can configure search patterns and replacement strings through the plugin's settings, and execute the command via a hotkey or the command palette. It's particularly useful for bulk text modifications, such as changing header levels, removing formatting, or adjusting embed link syntax.

Reviews

No reviews yet.

Stats

36
stars
20,864
downloads
1
forks
1,868
days
17
days
17
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
6
total issues
6
open issues
0
closed issues
0
commits

Latest Version

18 days ago

Changelog

README file from

Github

Find and replace in selection

This plugin for Obsidian adds a "Find and replace in selection" command. This command performs a search in the selected text, and all found characters/words/text constructions will be replaced with others. The plugin can search for plain text or regular expressions.

How to configure

Assign a hotkey to "Find and replace in selection" command.

How to use

  • In the plugin settings, specify which text to search for (plain text or regular expression) and what to replace it with.
  • Just select the text (you can select the entire note) and press hotkey or call "Find and replace in selection" command. To quickly make a replacement in one line of text, you can simply put the cursor on this line and press the hotkey.

Examples

Remove bold highlighting from all text:

  • Text to find: "**"
  • Replace by: "" (empty)

Replace all H2 headers with H3 headers:

  • RegExp to find: "^## " (space at the end)
  • RegExp flags: "gm" (global, multiline)
  • Replace by: "### " (space at the end)

If you want to make all H1 become H2, all H2 become H3, H3 become H4, then you need to start with H3, then H2, then H1.

Remove all display text from embed links:

  • RegExp to find: "(?<!\\)\!\[(.*?)(?<!\\)\]\((.*?)(?<!\\)\)"
  • RegExp flags: "gm"
  • Replace by: "![](https://raw.githubusercontent.com/dy-sh/obsidian-find-and-replace-in-selection/HEAD/$2)"

As result, this: ![Description](https://raw.githubusercontent.com/dy-sh/obsidian-find-and-replace-in-selection/HEAD/URL) will become: ![](https://raw.githubusercontent.com/dy-sh/obsidian-find-and-replace-in-selection/HEAD/URL)

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
aDHL
a year ago by tine-schreibt
The Dynamic Highlights Plugin, but with hotkeys, more options and sorting; works well with Highlightr.
Auto Replacer
10 months ago by Alecell
A live text replacement plugin that applies automatic formatting, corrections, or custom replacements in real-time. Define your own regex-based rules and transformation logic to modify text dynamically as you type.
AutoMover
a year ago by Al0cam
Move files and notes with specified names into their designated folders according to rules you define.
Blue Star
2 years ago by Wang Guoshi
A plugin for Obsidian that generates Anki flashcards in various ways.
Bulk Rename
4 years ago by Oleg Lustenko
Custom Selected Word Count
a year ago by banisterious
Custom Selected Word Count for Obsidian
Dynamic Highlights
4 years ago by nothingislost
An experimental Obsidian plugin that highlights all occurrences of the word under the cursor
Dynamic Text Concealer
2 years ago by Matt Cole Anderson
Obsidian.md Plugin to conceal or replace user configured text patterns in Live Preview and Read Mode.
File Explorer++
3 years ago by kelszo
A plugin for https://obsidian.md, which enables the ability to hide and pin specific files and folders in the file explorer by applying custom filters.
FileName Styler
a year ago by Marc Feininger
An Obsidian plugin to hide, customize, and decorate file names in the sidebar using regex and customizable profiles.
Find & Replace in Selection
5 years ago by TClark1011
Find Orphaned Images
2 years ago by Josmar Cristello
Find Orphaned Images is an Obsidian plugin designed to help you keep your vault clean and organized by identifying and managing images that are not linked anywhere in your notes.
Global Search and Replace
3 years ago by Mahmoud Fawzy Khalil
A plugin to do a global search and replace in all your Obsidian vault files.
Hide Commands in Menu
a year ago by bomian98
Obsidian Plugin, hide different commands in different menus.
Linkify
4 years ago by Matthew Chan
LinkMagic
2 years ago by AndyReifman
R.E.L.A.X.
2 years ago by Syr
Regex Obsidian Plugin
Regex Find and Replace
4 years ago by Martin Eder
Plugin for Obsidian, providing search/replace functionality which supports regular expressions and selections.
Regex Line Filter
a year ago by 64MM4-KN1F3
A note filtering plugin for Obsidian
Regex Mark
2 years ago by Mara-Li
Regex Pipeline
5 years ago by No3371
An Obsidian plugin that allows users to setup custom regex rules to automatically format notes.
Relative Find
5 years ago by phibr0
Tag Links
2 years ago by Zacchary Dempsey-Plante
A plugin for Obsidian that allows tags to be opened as links using a hotkey.
Text Finder
a year ago by hafuhafu
Provides a find/replace window in edit mode similar to VSCode (supports regular expressions and case sensitivity).
URL Formatter
8 months ago by Thomas Snoeck
Automatically formats specific URLs pasted into Obsidian into clean Markdown links.