---
# System prepended metadata

title: Spell rework

---

# Spell rework

## Alternatives

General notes: there will never be an all-around better solution

- [hunspell](https://hunspell.github.io/): defacto OSS spellchecker, worse english suggestions
- [aspell](https://aspell.net/): better perfs, LGPL, english-focused, good suggestions, horrible interface
- [nuspell](https://nuspell.github.io/): better perfs, C++, severely lacking API, worse english suggestions
- [enchant](https://abiword.github.io/enchant/): requires system specific configuration for all users, contradicts the "sane defaults approach"

## `:h spell-load` changes

The order is now, for `{lang}`:
1. Find where `{lang}.aff` is located in `rtp`
2. Load the `{lang}.dic` file next to it
3. Find all `{lang}.dic` file and add them to the previously loaded dictionnary
4. Use `'spellfile'` to determine the appropriate spellfile to load

Most spell options are stored on a per-buffer basis, but not the actual language list.
While is seems strange, it is because legacy vim considered the spellfiles as _languages_ and identifies the languages to the path to their `.dic`.
That meant that a `spellfile` was actually just a language whose path was a `.add`.
This meant special casing the search of words in that case (see `slang_T.sl_add`).

## TODOs

- [ ] Find whats left to remove from `spellfile.c`