I’m programming in C and would like to use the spell check for the comments only. Is it possible somehow to limit the scope of the spell checker only to C comments? because in the normal source code the spell checker always finds a lot of errors.
Spell check for comments only
Check the default settings file. There should be a setting that controls where spell checking is active, in Form of a scope selector. By default, it is active for comments and strings.
I’m on mobile so I can’t check.
As @FichteFoll mentioned, there is a setting called spelling_selector
that controls the scopes where spell checking is applied. It looks like the default should do what you want out of the box, though.
I wrote some nonsense code and it seems to only trigger on spelling errors in comments and not in function, parameter or variable names. Perhaps a plugin has messed with the default setting or something? Can you provide an example of some code that’s triggering errors for you? Is this in Sublime 3 or 2 (I’m using 3)?
I came a cross the same issue in Sublime 3, 4126 on Windows 10/64bit. spelling_selector
is actually set to this:
"spelling_selector": "markup.raw, source string.quoted - punctuation - meta.preprocessor.include, source comment - source comment.block.preprocessor, -(source, constant, keyword, storage, support, variable, markup.underline.link, meta.tag)",
I left only:
"spelling_selector": " source comment - source comment.block.preprocessor)",
in settings. Now only comments are checked for spelling.