Sublime Forum

Code coloring for html tags like TABLE and INPUT

#21

Anyone know how to get custom colouring working in ST3? I’ve done the exact same thing as I have done in ST2 but it’s not working.

0 Likes

#22

Syntax definitions and color schemes work exactly the same way as they did in ST2. The only difference is how packages are handled.

Check github.com/skuroda/PackageResourceViewer to extract the files to the right locations. You should be able to use that plugin and just save the file when you are done and it should have the correct name (and folders are automatically created). Remember that you need to do this with both the syntax definition and the color scheme - and a restart won’t hurt. You can test if the syntax definition works by inspecting the scope of the tag in question. If it’s working as expected, chances are you did something wrong with the color scheme.

0 Likes

#23

colorcoder does color each html tag in a different color

0 Likes

#24

[quote=“FichteFoll”]Syntax definitions and color schemes work exactly the same way as they did in ST2. The only difference is how packages are handled.

Check github.com/skuroda/PackageResourceViewer to extract the files to the right locations. You should be able to use that plugin and just save the file when you are done and it should have the correct name (and folders are automatically created). Remember that you need to do this with both the syntax definition and the color scheme - and a restart won’t hurt. You can test if the syntax definition works by inspecting the scope of the tag in question. If it’s working as expected, chances are you did something wrong with the color scheme.[/quote]

As I said in my previous post, I’ve done exactly this. I used PackageResourceViewer to open the HTML package and to edit HTML.tmLanguage, add the code that I previously posted, which works perfectly in ST2, saved it, restarted, nothing happens. I’m using the exact same color scheme for both ST2 and ST3 which has these new colors defined.

ST-2

http://www.resdivina.com/img/st2-colors.png

ST-3

http://www.resdivina.com/img/st3-colors.png

I want to specifically change just a couple of HTML tags in my scheme. I do not want to apply a rainbow of colors and wholesale changes to my theme (including backgrounds, line numbers, tab indicators, etc.) so it no longer looks even remotely the same.

0 Likes

#25

Anyone?

0 Likes

#26

.sublime-package files are effectively just ZIP files with a different extension. If you open a file contained within a ZIP and just hit “save” it’ll probably be saved somewhere else. Just a thought; did you open up the sublime-package file again to make sure the changes you made have been updated in the ZIP file?

Another option is to save the modified HTML.tmLanguage file in your User folder. Sublime will pick up files in there - tmLanguage, python scripts and configs - and use them in preference to files stored elsewhere. For example, I use a modified Soda Dark.tmTheme file that’s just saved in my User folder. AFAIK, tm*** files are unchanged between ST2 and ST3, so anything you do in ST2 tmLanguage files should work equally in ST3.

A third suggestion by way of investigation, is to take a copy of your working ST2 HTML.tmLanguage file and drop it in your User folder for ST3 in its entirety.

0 Likes

#27

I’m not sure if this helps or not. The primary difference between ST2 and ST3 is ST2 is written in Python2 and ST3 is written in Python3. Some of the packages don’t work in ST3 because of the upgrade. This may be why your ST2 code doesn’t work in ST3. Just a guess on my part.

viewtopic.php?f=3&t=14020&p=53396&hilit=package+control+not+working#p53396

0 Likes

#28

Thanks for the feedback folks. When I’ve got a bit more spare time I’ll take another crack at it.

Cheers.

0 Likes

#29

You resolved it? I have the same problem …

0 Likes