Sublime Forum

Multiple syntax display in one file

#1

Is it possible to display multiple syntax in one file in Sublime?
For eg. if i want to embed java code blocks in a plain text file, is there a way to define java syntax ONLY for the java code in the plain text file?

"""
Plain text (Syntax: Plain text)
"""
"""
Java code (Syntax: Java)
"""
"""
Plain text (Syntax: Plain text)
"""
0 Likes

#2

Yes, you basically need to define a begin and end pattern. You can then include an already defined syntax by specifying an appropriate scope. This is how javascript syntax can be embedded in html files. I answered a similar question on stackoverflow a while ago. May be worthwhile to look at.

stackoverflow.com/questions/1543 … 2#15441612

0 Likes

#3

Thanks so much! :smiley:

With a bit of reading around & tweaking, I finally got it working!

0 Likes