Wednesday, May 17, 2023

ask Vim why the word under the cursor is misspelled

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.

Thanks!
-Adam


Related:

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAKKOqGO_ipiwMJBjij%3DWWFFbKX3noF2Mp-JZSkNBBmRD_Guk6g%40mail.gmail.com.

No comments: