There are too many acronyms and proper nouns to add to the dictionary. I would like any words that contains a capital letter to be excluded from spell checking. Words are delimited by either a whilespace or special characters (i.e., non-alphabetic characters). Is this possible?
The first part of the answer fails when the lowercase and special characters surround the capitalized word:
,jQuery,
, iPad,
/demoMRdogood/
[CSS](css)
`appendTo()`,
The current answer gives false positives (excludes from the spellcheck) when the lowercase words are delimited by a special character. Here are the examples:
(async)
leetcode, eulerproject,
The bounty is for the person who fixes this problem.
vim Spell checker Spell Checking To turn on the vim spell checker run :set spell . To turn it off run :set nospell .
Using Spellchecking To move to a misspelled word, use ]s and [s . The ]s command will move the cursor to the next misspelled word, the [s command will move the cursor back through the buffer to previous misspelled words. Just hit Enter if none of the suggestions work, or enter the number for the correct word.
To add words to your own word list: zg Add word under the cursor as a good word to the first name in 'spellfile'. A count may precede the command to indicate the entry in 'spellfile' to be used. A count of two uses the second entry. In Visual mode the selected characters are added as a word (including white space!).
You can try this command:
:syn match myExCapitalWords +\<[A-Z]\w*\>+ contains=@NoSpell
The above command instructs Vim to handle every pattern described by \<[A-Z]\w*\>
as part of the @NoSpell
cluster. Items of the @NoSpell
cluster aren’t spell checked.
If you further want to exclude all words from spell checking that contain at least one non-alphabetic character you can invoke the following command:
:syn match myExNonWords +\<\p*[^A-Za-z \t]\p*\>+ contains=@NoSpell
Type :h spell-syntax
for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With