Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from serverfault.com Oct 30 '13 at 13:28

This question came from our site for professional system and network administrators.

    
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 Oct 31 '13 at 1:13
    
@Heptite No I'dont have an error message. The spellcheck works on linux with the same .vimrc file defined. –  user48777 Oct 31 '13 at 6:20
    
Try setting spelllang to en_us instead. –  Heptite Oct 31 '13 at 7:11
    
@Heptite see my edited question above. –  user48777 Oct 31 '13 at 7:16
2  
Then 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 Oct 31 '13 at 18:32

1 Answer 1

up vote 0 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.