I have the following code in a php page:

<?php

$query = "
    SELECT data 
    FROM table 
    WHERE param = 1 
";

Since this sql is wrapped inside quotations in a php document, everything shows up a solid green (or whatever color you have set for a string's syntax highlight).

Is there a way to get sublime text 2 to properly color the sql even with it inside a php string?

link|improve this question

60% accept rate
feedback

1 Answer

You will have to edit the PHP.tmLanguage located in Data\Packages\PHP. You should probably set a regex rule (as MySQL queries begin with SELECT/DESCRIBE etc.) and assign proper context.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.