[vim/vim] Support "blacklist" mode for :spell (Issue #20027)

2 views
Skip to first unread message

ruro

unread,
12:37 PM (6 hours ago) 12:37 PM
to vim/vim, Subscribed
ruro created an issue (vim/vim#20027)

Problem

.add/.spl dictionary files have the concept of "good" words, "bad" words and "rare" words. However, for words not present in any dictionary files, vim just always assumes that they are "bad" (and these "bad" words are basically indistinguishable from explicitly marked "bad" words).

This makes sense, when you vim as a "whitelist" spellchecker. The dictionary files must contain all "valid" words and everything else must be a typo / misspelling.

I would like to be able to use vim as a "blacklist" spellchecker. I have prepared a dictionary of common typos / misspellings and a suggestion file with ways to fix those typos / misspellings. I want vim to highlight only these words using SpellBad and offer me the suggestions I specified. This currently isn't possible(*), because vim just assumes that every word is bad by default.

Describe the solution you'd like

There are a few possible solutions:

  1. Add a spellunknown = "bad" option. Changing it to "good" (or "rare") would change which category vim puts the words that are not present in any dictionary.

  2. Add a fourth (fifth if you count "cap") category of words "unknown".

  3. Have special handling for the case when spelllang = "" + spell = true (or maybe when spellang = "empty" or when the dictionary for the selected language is empty).

I have no strong preferences one way or another. Option 1 seems fairly reasonable and simple to implement to me. Option 2 might be more convenient / powerful in the long run. Option 3 has the (questionable?) advantage that modern LLMs keep confidently suggesting that setting spelllang to an empty value makes all words "good" (instead of disabling spell checking despite the value of "spell").

Describe alternatives you've considered

(*): I suppose you could create a dictionary that literally lists "all possible words" from a to zzzz... as good words, but that's kind of horrible. Another hacky solution could be to completely disable SpellBad highlighting and instead use SpellRare as the category for typos / misspellings.

Another possibility is to use a plugin, of course. However, vim already has a built in spell checker, so reaching for a third party solution for something so simple seems a little bit weird.

Additional context

Also, see downstream issue neovim/neovim#39154.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20027@github.com>

Reply all
Reply to author
Forward
0 new messages