README file from
GithubClipReplace
ClipReplace is a tiny Obsidian plugin that swaps the current text selection with the clipboard in one command.
It is designed for revision workflows where you already have a replacement on the clipboard and want to keep the old wording available immediately afterward.
Example
Before running the command:
Clipboard: The revised sentence.
Selected text: The old sentence.
Run ClipReplace: Replace selection & copy.
Afterward:
Note: The revised sentence.
Clipboard: The old sentence.
No temporary note, second copy operation, or manual delete/paste cycle is needed.
Usage
- Copy the replacement text to your clipboard.
- Select the text you want to replace in an Obsidian note.
- Run ClipReplace: Replace selection & copy from the Command Palette.
- Optionally assign the command a hotkey under Settings → Hotkeys.
The command is only available when the editor has a non-empty selection.
Safety behavior
ClipReplace deliberately performs the operation in a defensive order:
- Read the existing clipboard.
- Copy the selected text to the clipboard.
- Replace the selection with the old clipboard contents.
If clipboard access fails, the note is left unchanged. If editor replacement fails after the clipboard was changed, ClipReplace makes a best-effort attempt to restore the original clipboard contents and shows an Obsidian notice.
Privacy
ClipReplace does not send text anywhere, does not use telemetry, and does not make network requests. Clipboard and editor operations stay local to Obsidian and your device.
Installation
Community Plugins
Once ClipReplace is accepted into the Obsidian Community directory:
- Open Settings → Community plugins → Browse.
- Search for ClipReplace.
- Install and enable it.
Manual installation
Download main.js and manifest.json from a GitHub release and place them in:
<your-vault>/.obsidian/plugins/clipreplace/
Reload Obsidian and enable ClipReplace under Community plugins.
Development
Requirements:
- Node.js
- npm
Install dependencies:
npm install
Type-check:
npm run check
Development build/watch:
npm run dev
Production build:
npm run build
The production build writes main.js in the repository root.
Release checklist
For each release:
- Update the version in
manifest.jsonandpackage.json. - Update
versions.jsonifminAppVersionchanges. - Run
npm run checkandnpm run build. - Commit the generated
main.js. - Create a GitHub release whose tag exactly matches the manifest version, for example
0.1.0(novprefix). - Attach
main.jsandmanifest.jsonto the GitHub release.styles.cssis not required because ClipReplace has no custom styles.
License
MIT