[TxMt] newbie simple language grammar question

Allan Odgaard throw-away-1 at macromates.com
Tue Jul 17 08:41:23 UTC 2007


On 16. Jul 2007, at 23:20, Pete Siemsen wrote:

> I'm trying (for the first time ever) to make Textmate do syntax- 
> highlighting.  The files I want to highlight are JUNOS router  
> configuration files.  My beginning grammar is
> [...]
> When I set the language to JUNOS, folding works but the keywords or  
> comments stay the default color.  Do I need to do something else to  
> see color highlighting?  (assume nothing is too dumb - I'm a newbie  
> to this)

To see if your grammar is actually matching press ⌃⇧P on the  
elements it should match, then you’ll see the scope assigned to this  
part of the document.

The keyword rule looks correct, but the comment rule will only work  
for block comments on a single line. To make it span multiple lines  
instead use begin/end like this:

     {   name = 'comment.block.junos';
         begin = '/\*'; end = '\*/';
     },

As for coloring, they should inherit the styles already setup for  
comment and keyword (if matched correctly).

> Assuming I get this working, is there a repository of grammars  
> where I can share it?  And maybe find grammars for other odd  
> languages?

There’s a huge repository of existing bundles: <http:// 
macromates.com/svn/Bundles/trunk/Bundles/>






More information about the textmate mailing list