How do I get TextMate 2 to enable spellchecking in a scope that is not checked by default?

341 views Asked by At

TextMate 2 has per-context settings for spell-checking: So in one document, spellchecking can be on for text, off for code, back on in quoted strings, off in comments, etc.

In this case, I want to change a default spell-checking to enable checking in comments when using the R language. How to?

1

There are 1 answers

0
tim On

You need to edit a setting that enables/disables spell checking in the scope you want to change.

To do this, you need to know the scope (in this case comment.line.number-sign.r) You can see the scope by putting the caret in the text you want to change and pressing ^⇧-P.

Now, you want edit the settings item in the bundle which is controlling the setting you want to edit.

Just press ^⌘-T (Select Bundle Item)

Now activate the Settings tab in this dialog (press ⌘⇧})

You want the spellchecking item for this bundle (source, in this (which is the parent of all the code bundles, like R - this change will affect all source languages. To make a more specific change, you would create a setting affecting just your language).

You need to edit (press the edit button) this setting, or to override it with a new, more specific scope.

You could just add a scope to the comma delimited scope selector string, in this case `source comment.line.number-sign.r,'.

However, that will make a delta version of the source bundle, and lead to hassles over time with updating and maintenance. So... It's better to make your own setting in your personal custom bundle, rather than messing with the shared and auto-updated bundles.

To do this, right click the existing item, reveal it in the Finder, make a copy in your own bundle. Then open it (in XCode's plist editor) and replace both the scope selector and the UUID (generate a new one with uuidgen in the terminal).

And there, in 10 steps, you go :-)

Sorry it's not easier, but this is a pretty fine-grained question.