Sublime Forum

HTML code Monokai color scheme - can I make <!--#include tags look different to plain comments?

#1

I have a lot of ssi insert tags like

<!--#include file="some_file.htm" -->

Sublime editor paints them grey, just like all the other plain comments, for example:

<!-- some comment -->

Is there some way to get it to differentiate between <!– and <!–#include and color them differently?

0 Likes

#2

Yes, there is. You can edit the HTML syntax and add a different scope when it matches <!--#include.

There could be other ways as trying to create a new syntax which extends the default HTML syntax the try to scope these things as you wish, but I am not sure whether it will work correctly.

0 Likes

#3

Ok thanks, but I apologise, I have no idea what you mean by “edit the HTML syntax”. Where and how do I do that?

0 Likes

#4

Sublime Text highlight the source code files by using Syntax files and Color Scheme files. You can read about then on:

Syntax files

  1. https://www.sublimetext.com/docs/3/syntax.html
  2. http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html

Color schemes

  1. http://docs.sublimetext.info/en/latest/reference/color_schemes.html
  2. Creating a custom color scheme?
  3. Color Scheme Editor for Sublime

I think you learn how to "edit the HTML syntax" by reading the thread:

0 Likes

#5

I see. Well, thanks for your reply. I hoped it would be simpler, this looks like a little over my head though, I don’t really understand much of it :confused:

0 Likes