Sublime Forum

Is it possible to use two syntaxes/themes at the same time?

#1

I´ve written a fairly simple pair of syntax and theme files where I basically only color code rows starting with a certain set of character. Is it possible to run this syntax in combination with some other syntax, for example Python or LaTeX?

I realize that I could take my few lines of code and incorporate it into other syntax/theme files, but I would like to be able to not do this for every syntax I might want to use (as well as not having to update my syntaxes whenever a new version of the original syntax comes out).

Is this possible to do?

0 Likes

#2

Could you present an example of sorts that would allow to better understand your problem ?

0 Likes

#3

Sure. I have a file called x.sublime-syntax and a file called x.sublime-color-scheme. Togeterh, they make it so that every row that starts with the letter x is colored red. Now, in addition to this, whenever a row isn’t color red, I’d like to switch between having a standard Python markup and a standard JavaScript markup (so that rows that do no start with the letter x are colored as usual according to the Python or JavaScript syntax).

0 Likes

#4

You can do this using embed, see http://www.sublimetext.com/docs/syntax.html

0 Likes

#5

I needed to color-highlight Latex tags as well as html tags. See color-highlight-latex-commands-within-html-file for the syntax I used.

0 Likes