How to enable vim spellcheck on windows and cygwin

0

How to enable vim spellcheck on windows and cygwin? I have tried with:

set spell spelllang=en

but it doesnt work.

Edit: As it turns out it has to do something with the syntax enabled. I'm using vim with mintty and cygwin. If I turn off syntax, spellcheck works correct. The misspelled words are highlighted and I can jump between them. If I turn syntax on the misspelled words are not highlighted and I cannot jump between them.

user48777

Posted 2013-10-28T10:57:29.073

Reputation: 303

Just "it doesn't work"? Do you get an error message? What type of file are you trying to edit? Plain text? What version of Vim? – Heptite – 2013-10-31T01:13:42.113

@Heptite No I'dont have an error message. The spellcheck works on linux with the same .vimrc file defined. – user48777 – 2013-10-31T06:20:58.000

Try setting spelllang to en_us instead. – Heptite – 2013-10-31T07:11:13.597

@Heptite see my edited question above. – user48777 – 2013-10-31T07:16:33.370

2Then it is an issue with the syntax file. In order for spell to work the syntax file has to explicitly assign areas where spell checking is allowed. – Heptite – 2013-10-31T18:32:59.077

Answers

0

A syntax plugin has to specify which of its defined groups will be spellchecked. That's because it doesn't make sense to highlight language keywords (think of int, struct, etc.) and variable names as spell errors, but mostly just (for programming languages) comments.

Have a look at the syntax plugin (you'll find it in $VIMRUNTIME/syntax/<filetype>.vim, and check for contains=@Spell and :syntax spell. Most plugins now come with spell support; if not, you need to add that (and contribute your enhancement back to the author, or ask the plugin's author for spell support).

Ingo Karkat

Posted 2013-10-28T10:57:29.073

Reputation: 19 513