NoWeDoR NoWeDoR - 10 days ago 5
AngularJS Question

Why some codes are colourful, some aren't in Sublime Text 3?

I had created angular quick start but as I mentioned in title some codes aren't colourful. How can I solve this?

For example:

enter image description here

enter image description here


By default sublime check extension of file and set highlighting for language (based on extension). For your case he knows that .js is javascript but he does not recognize .ts extension so he choosed plain text.

If sublime does not recognize which language the file has you can still define language in file manually.

In the right bottom corner in Sublime you can see for second file the "syntax highlighting" is set to Plain text.

enter image description here

Click on plain text and select javascript for example:

enter image description here