Word Scalpel

approved

by Grich Hiranyaphinant

Precise word deletion for Thai and Japanese — fixes Option+Backspace so it deletes one word at a time instead of the entire sentence. - This plugin has not been manually reviewed by Obsidian staff.

72 downloadsUpdated 1mo ago

Word Scalpel

An Obsidian plugin that fixes Option+Backspace (delete word) for Thai and Japanese text.

The problem

In English, Option+Backspace deletes one word at a time — stopping at spaces and punctuation. That works because English separates words with spaces.

Thai and Japanese don't. Words run together with no spaces between them, so Obsidian's default behaviour treats an entire sentence (up to the last space) as a single "word" and deletes all of it. One keypress, entire sentence gone.

Google Docs and Microsoft Word handle this correctly because they use language-aware word segmentation. Obsidian (built on CodeMirror) doesn't — so this plugin fixes it.

The fix

Word Scalpel intercepts Option+Backspace and, when the cursor is positioned after Thai or Japanese text, uses the browser's built-in Intl.Segmenter API to find the correct word boundary. One keypress deletes exactly one word.

For English and other space-delimited languages, the default Obsidian behaviour is unchanged.

Supported scripts

ScriptExample
Thaiสวัสดี
Japanese Hiraganaこんにちは
Japanese Katakanaコンピュータ
Japanese Kanji日本語

Installation

From the community plugin list (recommended)

  1. Open Obsidian Settings → Community plugins
  2. Disable Safe Mode if prompted
  3. Click Browse and search for Word Scalpel
  4. Install and enable

Manual

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Copy them to .obsidian/plugins/word-scalpel/ in your vault
  3. Enable the plugin in Settings → Community plugins

How it works

The plugin registers a CodeMirror 6 extension that intercepts Alt-Backspace with the highest priority. When triggered:

  1. It checks the character immediately before the cursor
  2. If it's Thai or Japanese, it uses Intl.Segmenter with the appropriate locale (th or ja) to find word boundaries in the current line
  3. It deletes exactly the last segment
  4. If it's any other script, the keypress falls through to Obsidian's default handler

Author

Grich Hiranyaphinant — GitHub

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.