Sublime Forum

Multi-syntax

#1

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?

0 Likes

#2

This is definitely possible, but requires editing your .tmLanguage files.

0 Likes

#3

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:

    <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>
0 Likes

#4

Thanks for the replies. Might be too complex for me to do it myself.
I thought someone already had done it. :smile:

0 Likes

#5

You could try github.com/phuibonhoa/handcraft … ate-bundle). Install it from Package Control, search for “Haml”.

0 Likes