Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I am editing a plain text document and making notes in it, TextMate will put red lines under parts of it which should not be spell checked:

enter image description here

How can I disable spell checking for a block of text? I don't even mind if I have to wrap it inside of something like {{ and }}.

In the Textmate Manual it says

Since TextMate is intended for structured text it is possible to exclude parts of the document from being checked. This is done by creating a preferences item in the bundle editor, setting spellChecking to 0 and filling in the scope selector with the selector to target for no spell checking.

But I am still unclear about how to do this - I don't even see the spelling section in my preference pane (cmd+,, right?)

I'm looking for a few step-by-step instructions of how to disable spell checking for part of a plain text document.

share|improve this question
    
What textmate version? –  Daniel Beck Dec 21 '11 at 3:27
    
@DanielBeck 1.5.10 (latest) –  cwd Dec 21 '11 at 3:36
    
What programming language / syntax is this? –  Daniel Beck Dec 21 '11 at 3:50
    
It's a plain text file that I use for reference. I don't like that it is underlining mis-spellings for code words. i suggested delimiters for "scoped" sections of {{ and }} but i would be open to other delimiters. i do want it to check spelling on the actual text part of the document. –  cwd Dec 21 '11 at 4:18
    
No, I meant what language for syntax highlighting etc. do you have selected in TextMate? Plain text then? –  Daniel Beck Dec 21 '11 at 4:19
show 1 more comment

1 Answer

up vote 2 down vote accepted

TextMate uses user-configurable bundles of scripts and language definitions for syntax highlighting, indentation recognition, and the menu items in the Bundles menu.

TextMate can be extended by adding new bundles to e.g. support other programming languages.

Likewise, you can edit existing bundles to match your custom requirements.


You can view your bundles and their contents via Bundles » Bundle Editor » Show Bundle Editor.

The following instructions will explain how to ignore the text between two delimiters for spell checking.

enter image description here

  1. Open the Bundle Editor
  2. Select the Text bundle's Plain text language entry in the list.
  3. Add the following to the list of patterns matched under contentName = 'meta.paragraph.text' as a sibling to the block whose name is markup.underline.link.text:

    {   name = 'meta.no-spellcheck';
        begin = '{{';
        end = '}}';
    },
    

    This defines a new scope, named meta.no-spellcheck, as a subscope to the regular meta.paragraph.text scope. So only if a scope is a regular text paragraph will it also possibly be a meta.no-spellcheck scope, and therefore excluded from spell checking.

  4. In the Text » Spell Checking: Disable item, add meta.no-spellcheck to the Scope Selector list. This will apply the rule to all meta.no-spellcheck scopes.

  5. Close the Bundle Editor and test your changes (no saving needed).


To view a certain position's active scopes, press Ctrl-Shift-P. This can help you in defining your own rules.

enter image description here

share|improve this answer
    
looks great - thanks very much –  cwd Dec 21 '11 at 23:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.