Sublime Forum

[Request] Conditional Syntax Hi-lighting for inline scripts

#1

I’d like my bash scripts to apply the correct syntax hilighting for inline scripts.

For example, by providing the !SQL hint in the bash script, ST2 will then apply the syntax hi-lighting for any *.sql files to the relevant text.

[code]#!/bin/bash

sqlplus scott/tiger@ORACLE <<!SQL

SELECT NULL FROM DUAL
/
EXIT
!SQL

echo “All Done”
[/code]

0 Likes

#2

oh, it would be awesome for things like diffs browsing etc. +1111

0 Likes

#3

You can do something like this (though it would take some work from you). I embedded html syntax highlighting in the graphviz tmLanguage file. You can take a look at my answer here for a bit more information. If you can identify the being/end patterns(say with your !SQL hint), you can include another defined highlighting definition. If I recall, this is how html/javascript highlighting works.

0 Likes