news <[EMAIL PROTECTED]> 写于 2006-11-28 21:18:55:
>  I'd like to know if there is a way to tell Vim to recognize identifiers
> occurring inside the comments/strings in source code as being valid
words.
> E.g. if I have
>
>         // function foo() does whatever it does
>                     ~~~
>         void foo() { ... }
>
> and "spell" option is on, the first "foo" is highlighted as a misspelt
word
> as indicated above (the second one isn't as spell checking is done only
inside
> comments and strings (which is good, but not quite enough)). Is there any
way
> to ignore all identifiers for spell checking? E.g. ignore all words
occurring
> outside of comments/strings in the same buffer or maybe all identifiers
from
> the tags file or maybe something even better which I didn't think of?
>
>  Thanks in advance for any ideas,

Generally, it is not a good practice to use // or /* */ to comment out
codes. (a better approach might be "#if 0" and "#endif"), so if you use #if
0 there would not be problem.

If you just want all identifiers to be valid word, there has been somewhere
a method to permenantly add all identifiers in a tags file to your
dictionary. But it is inconvinient, since tags file will change frequently,
and you may want to use different tags file with different project.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Reply via email to