Fast, conservative autocorrect while typing in Logseq.
Fixes common typos on word boundaries (space / punctuation / Enter) without heavy linting, grammar checking, or cloud services.
This plugin is designed to feel invisible: you type, mistakes quietly disappear, and your notes remain plain Markdown.
UK English Focus: This extension prefers UK English spellings (colour, favour, organise, etc.) and will never auto-convert UK → US spellings.
Logseq’s built-in spellcheck highlights mistakes, but fixing them interrupts flow.
Other tools add grammar or style “linting” that feels slow, noisy, or distracting.
Autocorrect for Logseq exists to solve a narrower problem:
- You write quickly
- You make predictable typos
- You want them fixed instantly
- You don’t want grammar rules, popups, or background scanning This plugin does one thing well: safe, instant typo correction while typing.
- Autocorrects common typos only when you finish a word (on word boundaries)
- Operates only on the currently edited block
- Keeps your notes as plain
.mdfiles - Works fully offline by default
- Supports optional, cached remote dictionary updates
- UK English preferred: Never corrects UK spellings (colour, favour, etc.)
- Conservative: Avoids ambiguous corrections (won't change "from" to "form")
Common typos that get corrected:
teh→thehelath→healthwoudl→wouldcommnity→communitysocila→social
UK English words that are never corrected:
colour,favour,behaviour,honour,labourorganise,realise,recognise,analysecentre,metre,theatre- And many more...
- ❌ No grammar checking
- ❌ No style suggestions
- ❌ No full-document scanning
- ❌ No cloud dependency by default
If you want grammar tools, use them separately. This plugin focuses on typing speed and flow.
- Open Logseq
- Go to Settings → Plugins
- Search for "Autocorrect for Logseq"
- Click Install
- Clone this repository
- Install dependencies:
npm install
- Build the plugin:
npm run build
- Enable Developer Mode in Logseq
- Open Plugins → Load unpacked plugin
- Select the plugin's
dist/directory
See TESTING.md for detailed step-by-step testing instructions.
# Install dependencies
npm install
# Build the plugin
npm run build
# Watch mode (rebuilds on changes)
npm run watch
# Rebuild the dictionary from codespell
npm run build-dict
# Clean build output
npm run cleanOnce installed, the plugin works automatically. It triggers corrections when you:
- Type a space after a word
- Type punctuation (
.,,,;,:,!,?) - Press Enter
Access settings via Settings → Plugins → Autocorrect for Logseq:
- Enable autocorrect: Turn the plugin on/off
- Mode:
safe(default): Conservative corrections onlyexpanded: More aggressive corrections (future feature)
- Use remote dictionary updates: Enable automatic dictionary updates
- Remote dictionary URL: URL to fetch dictionary updates from (JSON format)
- Remote update interval: How often to check for updates (hours)
- Personal rules: Add your own custom corrections manually via Settings. Supports JSON format (matches
base_safe.json) or line-based format. Multiple JSON rules must be inside curly braces{}and separated by commas:{"typo1": "correction1", "typo2": "correction2"}. See "Personal Rules Format" section below for details.
Personal rules can be added manually in the plugin settings. There are two supported formats:
JSON format (recommended, matches dictionary format):
Multiple rules must be inside curly braces {} and separated by commas:
{
"teh": "the",
"woudl": "would",
"helath": "health"
}Line-based format (alternative):
teh the
woudl would
helath health
Comments (lines starting with #) are ignored in line-based format.
How to add personal rules:
- Go to Settings → Plugins → Autocorrect for Logseq
- Scroll to Personal rules
- Enter your rules in either JSON or line-based format
- Save settings
- Rules are applied immediately (no reload needed)
Note: Personal rules must be added manually via Settings. There is no command palette option for adding rules.
autocorrect-for-logseq/
├─ README.md # This file
├─ LICENSE # MIT License (code)
├─ DICTIONARY_LICENSE.md # CC BY-SA 3.0 (dictionary attribution)
├─ package.json # Node / build metadata
├─ logseq.json # Logseq plugin metadata
├─ tsconfig.json # TypeScript config
│
├─ dist/ # Build output (used by Logseq)
│ └─ index.js # Compiled plugin entry
│
├─ src/ # Source code
│ ├─ index.ts # Plugin entry point
│ ├─ autocorrect.ts # Core autocorrect logic
│ ├─ remote.ts # Remote dictionary loading
│ └─ dictionary/
│ └─ base_safe.json # Bundled typo dictionary (63k+ rules)
│
└─ scripts/
└─ build-dict.ts # Dictionary builder (from codespell)
- Word Boundary Detection: The plugin watches for word boundaries (spaces, punctuation)
- Word Extraction: When a boundary is detected, it extracts the word before the cursor
- Dictionary Lookup: Checks if the word matches a known typo
- Safety Checks: Applies conservative filtering:
- Never corrects UK English words
- Never corrects ambiguous words (from/form, to/too/two)
- Minimum word length (5 chars) except for safe short typos
- Case Preservation: Maintains original capitalization
- Correction: Updates the block with the corrected word
This project's code is licensed under the MIT License. See LICENSE for details.
The autocorrect dictionary (src/dictionary/base_safe.json) is derived from the codespell project and is licensed under the Creative Commons Attribution-Share-Alike License 3.0 (CC BY-SA 3.0).
See DICTIONARY_LICENSE.md for full attribution and license details.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
See CHANGELOG.md for full release history.
