14

I'm trying to add Typescript syntax highlighting support, which is provided by MSFT. However, I don't know what to do with that downloaded .zip to make Sublime recognize .ts files. I tried adding it to Installed Packages/Typescript, or just Installed Packages, but that hasn't worked. (I also tried extracting the .tmlanguage file and putting that in Installed Packages/Typescript.

What is the right way to do this? (I'm on Mac OS X 10.8 with Sublime text 2.0.1.)

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699

3 Answers3

23

To add TypeScript syntax highlighting support to Sublime Text on Mac:

  1. Unzip the downloaded file. It contains a file named typescript.tmlanguage
  2. Create a subfolder in your sublime Package folder called TypeScript. (The path to the Packages folder for Sublime Text 2 on Mac is:
    /Users/{user}/Library/Application Support/Sublime Text 2/Packages)
  3. Drop typescript.tmlanguage into your newly created TypeScript folder.
ahsteele
  • 26,243
  • 28
  • 134
  • 248
Claudijo
  • 1,321
  • 1
  • 10
  • 15
9

For me none of these ways actually worked as they should have.

Instead I had to hit (On a Mac and using Sublime Text 2) Cmd+Shift+P and then type Package Control:Install Package and then hit enter. You may see it load in the bottom left.

From there is was a matter of searching for the script (in my case TypeScript), selecting it and hitting enter.

Katana24
  • 8,706
  • 19
  • 76
  • 118
8

If you go to the Sublime Text website, they have instructions there. To make it work in Windows you have to create the Typescript folder at:

C:\Users\\AppData\Roaming\Sublime Text 2\Packages\TypeScript

and copy the typescript.tmlanguage file inside that folder. Claudijo provides an equivalent answer for Mac OS X users.

Community
  • 1
  • 1
Murat Sutunc
  • 943
  • 5
  • 9
  • Searching on `Typescript` on the Sublime Text website link you provided does not bring up anything on `Typescript` – Agent Zebra Jul 19 '16 at 21:26