Home Download Buy Blog Forum Support

Multi-syntax

Multi-syntax

Postby Fake Pilot on Thu Sep 26, 2013 9:42 am

Hello,

Is there a way to highlight syntax for multiple scripting languages or filters?

When using for example Haml in a Ruby on Rails app, there are times where you use filters. For example, :markdown :javascript :coffeescript
Using the syntax Rails HAML, all the filter areas all show up white with no syntax at all.

Anyone?
Fake Pilot
 
Posts: 2
Joined: Thu Sep 26, 2013 9:38 am

Re: Multi-syntax

Postby adzenith on Thu Sep 26, 2013 4:35 pm

This is definitely possible, but requires editing your .tmLanguage files.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Multi-syntax

Postby SeanJM on Thu Sep 26, 2013 9:22 pm

http://manual.macromates.com/en/languag ... #rule_keys

Your pattern would be something like this, except I am unsure what your end character would be, as I am not a ruby guy:

Code: Select all
    <dict>
         <key>begin</key>
         <string>:markdown</string>
         <key>end</key>
         <string>:endmarkdown</string>
         <key>patterns</key>
         <array>
            <dict>
               <key>include</key>
               <string>$self</string>
            </dict>
            <dict>
               <key>include</key>
               <string>text.html.markdown.multimarkdown</string>
            </dict>
         </array>
      </dict>
SeanJM
 
Posts: 6
Joined: Sat Jul 14, 2012 3:03 pm

Re: Multi-syntax

Postby Fake Pilot on Fri Sep 27, 2013 9:16 pm

Thanks for the replies. Might be too complex for me to do it myself.
I thought someone already had done it. :-)
Fake Pilot
 
Posts: 2
Joined: Thu Sep 26, 2013 9:38 am

Re: Multi-syntax

Postby dentarg on Mon Jan 20, 2014 4:43 pm

You could try https://sublime.wbond.net/packages/Haml (https://github.com/phuibonhoa/handcraft ... ate-bundle). Install it from Package Control, search for "Haml".
dentarg
 
Posts: 5
Joined: Wed Mar 28, 2012 8:48 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 24 guests