Sublime Forum

Customising syntax highlighting in HTML view

#1

I’m trying to specify a different highlight colour for , and

tags in HTML view (like how it is in DW) but the default colour themes on Sublime 2 don’t have this. Even in some custom colour themes I’ve downloaded, the creator has not coloured those specific tags differently. Is it because it’s not possible in the tool, or the keywords haven’t been utilised yet?

I had a go at modifying a theme file itself in “\AppData\Roaming\Sublime Text 2\Packages\Color Scheme - Default”

In this case I narrowed the tag key down to the following which highlights the tag if there is JS embedded, but not when it is a normal reference to a JS file.

name js embedded scope source.js.embedded.html punctuation.definition.tag - source.php, source.js.embedded.html entity.name.tag.script, source.js.embedded entity.other.attribute-name - source.js string settings foreground #842b44ff

How would it be done to also highlight script tags that are just references? Also,

and tags?
0 Likes

#2

I tried adding the following key, which still targets only a tag if it has embed code. Please see attached image. As you can see it is not targeting the other tags:

name Script tag scope entity.name.tag.script settings foreground #ffffff
0 Likes