[TxMt] Custom Changes

Daniel Stockman daniel at evocateur.org
Tue Oct 31 20:08:14 UTC 2006

> I'm trying to make some changes to the Language without losing the 
> ability to get updates (to the language).

As described in the manual, your changes to the default bundles will be
saved as a tmDelta (a diff file, basically) in ~/Library/Application\
Support/TextMate/Bundles, and won't affect the ability to update the
bundle in future versions.

> I want to have my documentation a different color from the commented
> out code.

Instead of a separate language grammar in the JavaScript bundle, I'd
suggest putting the keys inside your pattern block...

> { name = 'comment.documentation.docblock.js';
>   begin = '/\*\*';
>   end ='\*/'; 
>   captures = {0 = {name = 'punctuation.definition.comment.js';};}; 
> },
> { name = 'comment.documentation.line.triple-slash.js';
>   match = '(///).*$\n?';
>   captures = {1 = {name = 'punctuation.definition.comment.js';};};
> }

...inside the actual JavaScript language grammar's main patterns block.
You might reconsider the "\n?" at the end of the second match key;
I'm fairly certain it's redundant ("$" being the EOL symbol)

> I want to have a (space)* inserted at the beginning of newlines when
> I'm using the docblock format.

This smells like a Snippet (perhaps '**' for the tab trigger, then '*'
inside the comment.documentation.docblock.js scope to insert a new line
with the space+*)...


More information about the textmate mailing list