How to change word recognition in vim spell?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2009-08-14T13:58:49Z Indexed on 2010/06/01 20:13 UTC
Read the original article Hit count: 120

Filed under:
|
|
|

I like that vim 7.0 supports spell checking via :set spell, and I like that it by default only checks comments and text strings in my C code. But I wanted to find a way to change the behavior so that vim will know that when I write words containing underscores, I don't want that word spell checked.

The problem is that I often will refer to variable or function names in my comments, and so right now vim thinks that each piece of text that isn't a complete correct word is a spelling error. Eg.

/* The variable proj_abc_ptr is used in function do_func_stuff' */

Most of the time, the pieces seperated by underscores are complete words, but other times they are abbreviations that I would prefer not to add to a word list. Is there any global way to tell vim to include _'s as part of the word when spell checking?

© Stack Overflow or respective owner

Related posts about vim

Related posts about editor