- Notifications
You must be signed in to change notification settings - Fork2
A hackable minimalist framework for spellchecking
License
enzuru/company-spell
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
If you are happy withcompany-ispell
, this package is not for you, and you are encouraged to stick with company-ispell.
company-spell
is a hackable minimalist framework for spellchecking.
company-spell
directly uses your spellcheck program with no questions asked, and is compatible with ispell, aspell, and hunspell. Unlikecompany-ispell
, this works outside of thedefault Emacs ispell machinery.
There are three variables you can modify to adjust how in buffer spellchecking works. This minimalist approach that keeps less machinery between you and your spellchecker, and allows you to cultivate your in buffer spellchecking with a different approach than spellchecking elsewhere.
Due to this minimalist approach, multilingual support is probably not very good yet, as it currently does not track which language you are requesting spellchecking for.
I have not discovered any notable performance issues with this approach, and in fact, I have anecdotally found it to be faster thancompany-ispell
(no promises though!). aspell is the default because I find that it returns the best results.
It will automatically run on any buffer that has a major mode derived fromtext-mode
, which includes almost all modes meant for human writing.
Ensure that:
- A terminal spellchecker is installed (
aspell
,hunspell
,ispell
, etc) - You have setup access toMELPA
- Company is installed
M-x package-install company-spell(push'company-spell company-backends)
(use-package company-spell:config (push'company-spell company-backends):ensuret)
Optionally, set a spellchecker that isn't the default value ofaspell
:
(setf company-spell-command"hunspell");; or(setf company-spell-command"ispell")
You can further customize your results by setting custom args (only-a
is enabled by default). For instance, search via "soundslike":
(setf company-spell-args"-a soundslike")
You might want to setup your own function. This is a simple function that calls your spellcheck command with your arguments, and turns it into a list for Company.
(setf company-spell-function#'my-custom-function)
I've started usingCorfu andCape these days, which usecompletion-at-point
. Thankfully, this package is easy to adapt tocompletion-at-point
. With Cape installed, just write a hook like this for various text editing modes likemarkdown-mode
:
(setq-local completion-at-point-functions (mapcar#'cape-company-to-capf (list#'company-spell)))
Licensed under the GPLv3; copyright is assigned to my eponymous charityenzu.ru
About
A hackable minimalist framework for spellchecking