Frustrated by some limitations of the default spell plugin, I decided to try and rewrite it from scratch to make it more flexible and hackable - which involves writing as little KakScript as possible (for me at least)
- leverage existing lint.kak plugin for jumping to mistakes
- show a menu with suggestions
- New: add and remove kakoune selections to and from personal word list - this is what I missed the most when coming from vim
- New: use any backend supported by enchant, not just aspell
Enough talk, show me the code!
There are two parts:
The first part is a Python script that wraps enchant:
Note that the logic to display the kakoune completion menu is implemented there, where it is easy to test/debug
The second part is a rewrite from scratch of the spell.kak implementation. You can see the diff on GitHub
I hope you’ll agree it’s easier to read, maintain and extend.
Right now the plugin can only be used by patching the code of kakoune and installing a separate python project (and deal with pyenchant)
This not ideal, so if you like the idea of such a plugin and its implementation, feel free to tell me below and we can discuss easier ways to distribute the plugin - I kinda like the idea of just a Rust binary, ala kak-slp.
Also, I’m pretty satisfied with the features so far, but let me know if you have requests that would be hard to implement in the original spell.kak plugin (besides checking several languages at once - this is sadly not supported by Enchant)