I’d like to turn on spell check to avoid typos in comment, but in code those red underlines are really annoying…
Some file type plugins could do that for other languages, like Python, but I couldn’t find any c plugins.
I tried c.vim but it doesn’t work.
You should be able to modify the c syntax file to get the behavior you want. When you load a c file (or set a file to c filetype) the c syntax file is loaded from the /vimxx/syntax directory, it’s the file there named c.vim. This file has all the various syntax statements that establish elements that can be highlighted.
You will notice several statements throughout the file that end with
contains=and have@Spellamong the groups that are “contained”. If you remove@Spellfrom these statements (mostly string syntax items) and leave@Spellin the contains clause for “comment” elements (e.g.,cComment) that should do what you want.Be careful not to remove
@Spellfrom anycontains=ALLBUT,clauses, which, as you might guess, list syntax items that may not be contained in the given group.