I know it's possible to enable SQL syntax highlighting in PHP scripts using the option
let php_sql_query=1
But this just enables highlighting of all SQL keywords in every string. Even in a normal sentence like this one.
Is there a way to only enable this for strings starting with "Select", "update" or "delete"?
Enclosing the query in a heredoc with an identifier of "SQL" triggers Vim to do SQL syntax highlighting in the block, e.g.:
$q = <<<SQL
        SELECT `foo`
        FROM `db`.`table`
        WHERE `foo` = 'bar'
SQL;
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With