Home Download Buy Blog Forum Support

Multiple syntax display in one file

Multiple syntax display in one file

Postby dhruva08 on Sun Jan 26, 2014 5:24 pm

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?
Code: Select all
"""
Plain text (Syntax: Plain text)
"""
"""
Java code (Syntax: Java)
"""
"""
Plain text (Syntax: Plain text)
"""
dhruva08
 
Posts: 2
Joined: Sun Jan 26, 2014 5:16 pm

Re: Multiple syntax display in one file

Postby skuroda on Mon Jan 27, 2014 2:16 am

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.

http://stackoverflow.com/questions/1543 ... 2#15441612
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: Multiple syntax display in one file

Postby dhruva08 on Mon Jan 27, 2014 6:01 am

Thanks so much! :D

With a bit of reading around & tweaking, I finally got it working!
dhruva08
 
Posts: 2
Joined: Sun Jan 26, 2014 5:16 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 17 guests