Adam Monsen wrote:
> Is there a way to directly ask the Vim spell checker precisely why the word
> under the cursor is misspelled?
>
> It took me a bit to figure out how it paints a blue background behind bare
> words on a line because they are not capitalized. For example:
>
> foo
>
> I can figure it out pretty easily from the suggestions listed by typing z=
> in normal mode (while my cursor is on the highlighted non-capitalized word)
> because the first suggestion is "Foo" with a capital F.
>
> It would be handy to be able to get this information explicitly in Vim
> script, similar to how I can use synIDattr() and synIDtrans() to query the
> name and detail of the syntax highlighting group in effect at the current
> cursor position. Getting the group "SpellCap" or something like "word [foo]
> is not capitalized" would be helpful. I guess I'd prefer the first because
> it is unambiguous and ":help SpellCap" works as expected.
You can use spellbadword() for that.
--
Nothing is fool-proof to a sufficiently talented fool.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///