Word Scalpel

by Grich Hiranyaphinant
5
4
3
2
1
New Plugin

Description

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.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

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

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

Installation

  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