[TxMt] Question regarding scoping
throw-away-1 at macromates.com
Mon Oct 23 19:46:28 UTC 2006
On 22. Oct 2006, at 22:45, Branko wrote:
> Prototype framework. In this early develpment phase I like to write
> "source.js.embedded.html" gets added to the scope. How can I tell
> TextMate to use features from the Prototype & Scriptaculous bundle
> tedious and messes up the highlighting.
If you select Bundles → Bundle Editor → Edit Languages… you get
the ability to unfold the HTML bundle and edit its language definition.
There is an include for source.js somewhere there. You can change
that to source.js.prototype instead, to have it include the Prototype
Caution: by editing the HTML grammar, you won’t see future updates
to it, since you basically fork it. You can later revert to the
default grammars . Another approach is 1) duplicate the HTML
grammar before editing, change the scopeName (near the top) to e.g.
text.html.prototype, and use that for your HTML files, or 2) create a
new grammar which has just the <script> rule and includes
source.js.prototype and then includes text.html.basic. That way your
subclasses grammar will see changes done to the default HTML grammar,
as it just includes it (rather than duplicates and edits).
For more info see http://macromates.com/textmate/manual/
More information about the textmate