Home Download Buy Blog Forum Support

How do I make my own syntax highlighting colour scheme?

How do I make my own syntax highlighting colour scheme?

Postby hippocoder on Sat Oct 01, 2011 11:46 am

Hi,

I code in Unity, which uses a variant of javascript. I would like to add syntax colouring for unity commands. How do I do this? Thanks!
hippocoder
 
Posts: 1
Joined: Sat Oct 01, 2011 11:45 am

Re: How do I make my own syntax highlighting colour scheme?

Postby grayrest on Sun Oct 02, 2011 9:15 pm

You need to add a new .tmLanguage file. Check the packages folder to see the implementation of other languages. Since sublime uses textmate syntax files, you could potentially find a unity syntax file and save yourself the effort.
grayrest
 
Posts: 12
Joined: Thu Sep 29, 2011 5:03 pm

Re: How do I make my own syntax highlighting colour scheme?

Postby Mambo4 on Thu Jan 10, 2013 5:12 pm

I use Sublime for JSFL (Java Script Flash) and found that
I could get sublime text to recognize .jsfl files as JavaScript and hilite/color code ect appropriately by doing this:

1.)in sublime text menus, go to Prefernces/Browse Packages... to open your packages directory
2.) in the packages directory open the JavaScript folder
3.)in the JavaScritp folder select JavaScript.tmLanguage and open in SublimeText
4.) near the top of this file look for the chunk that lists the extensions it recognizes:
Code: Select all
   <key>fileTypes</key>
   <array>
      <string>js</string>
      <string>htc</string>
      <string>jsx</string>


5.) add <string>jsfl</string> to the list and save

now it will recognize .jsfl files as javascript

if unity code has its own extension (.unity or whatever) simply add it similarly
it won't recognize every unique unity syntax, but all the shared Javascript syntax will be good to go.
Mambo4
 
Posts: 6
Joined: Sat Sep 08, 2012 5:53 pm


Return to Technical Support

Who is online

Users browsing this forum: karbica and 22 guests