README file from
GithubWord 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
From the community plugin list (recommended)
- Open Obsidian Settings → Community plugins
- Disable Safe Mode if prompted
- Click Browse and search for Word Scalpel
- Install and enable
Manual
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Copy them to
.obsidian/plugins/word-scalpel/in your vault - 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:
- It checks the character immediately before the cursor
- If it's Thai or Japanese, it uses
Intl.Segmenterwith the appropriate locale (thorja) to find word boundaries in the current line - It deletes exactly the last segment
- If it's any other script, the keypress falls through to Obsidian's default handler
Author
Grich Hiranyaphinant — GitHub
License
MIT