How to get support of TypeScript with Sublime Text 3?

81,798

Solution 1

You can do this by pressing Ctrl + shift + p write ipc and press enter to open the Package Manager. After that, type TypeScript and choose the first option which is published by http://typescriptlang.org.

Note: For Mac OS users, use Command (⌘) + shift + p instead of Ctrl + shift + p.

Solution 2

If it's not already done, you first have to install the Package installer, like that:

  • Press Ctrl + shift + p
  • Type "inst" and select Install Package Control

The following pop-up appears:

Package Control was successfully installed

Use Command Palette and type "Install Package" to get started

Now you can install the Typescript support like that:

  • Press Ctrl + shift + p
  • Type "inst" and select Package Control: Install Package
  • Type "type" and select "Typescript"

Now you can open a file.tsand change the type to Typescript clicking in the right bottom of the editor where Plain Text is selected by default.

Solution 3

If you are using mac OS then use the following command

cd ~/"Library/Application Support/Sublime Text 3/Packages"
git clone --depth 1 https://github.com/Microsoft/TypeScript-Sublime-Plugin.git TypeScript

After that press cmd+shift+p in sublime text 3 , then type "TypeScript" and select "TypeScript" and press enter.

And on Windows:

cd "%APPDATA%\Sublime Text 3\Packages"
git clone --depth 1 https://github.com/Microsoft/TypeScript-Sublime-Plugin.git TypeScript

After that press Ctrl+shift+p write install packages and press enter, then type "TypeScript" and select "TypeScript" and press enter.

Solution 4

(If you're on Mac, press Cmd instead of Ctrl in the key combos below.)

Press Ctrl+Shift+P and type "Install package". If "Install package control" appears as an option, pick it, and then press Ctrl+Shift+P again and type "Install package". Pick "Package Control: Install Package". Wait a moment and a new dropdown menu will appear. Type "TypeScript" and pick the option with that exact name.

Solution 5

There is a TypeScript plugin for Sublime written by Microsoft that you can install. I would recommend installing it via PackageControl to make sure that it stays up to date.

The plugin provides syntax highlighting and a build system for building TypeScript applications using node.js and the TypeScript compiler (which is presumably what you mentioned downloading above).

The page linked includes install instructions as well as information on what it does for you and how to use it.

Share:
81,798
Mohan Gopi
Author by

Mohan Gopi

Each and every end of the day thinking what i have learned today. And Improving my self daily as developer.

Updated on July 20, 2021

Comments

  • Mohan Gopi
    Mohan Gopi almost 3 years

    I am currently working in Angular and I get good support of Typescript with Sublime Text.

    How can I get support of TypeScript with my Sublime Text editor?

    I tried to hit Shift + Ctrl + P and then typed TypeScript but I did not get any TypeScript results.

    I have gone through the official TypeScript website and I have cloned the Sublime Text to my PC.

    I have installed TypeScript on my laptop - what can I do next?

  • Pravinraj Venkatachalam
    Pravinraj Venkatachalam over 6 years
    After doing this, open a type script file in Sublime, in the right bottom of the sublime you can see plain text. Click on that plain text. A vertical pop up box (side nav bar) will be displayed. Scroll down to select "Typescript". After selecting you can see the color changes in that file.
  • stackMonk
    stackMonk about 6 years
    after installing "install packages" type "ctrl+shift+p" then type "install packages" and then when it will give a list of packages to choose, type "TypeScript" and press enter.
  • turingtested
    turingtested about 6 years
    Searched a lot for this solution, thanks! Works with Sublime Text 2 too, just do cd ~/"Library/Application Support/Sublime Text 2/Packages" instead.
  • jpat827
    jpat827 over 5 years
    Thanks to @turingtested for the suggestion to clone into the Packages directory instead of the base sublime-text-3 directory. The same applies to this answer which worked for me.
  • Carlos Pinzón
    Carlos Pinzón over 5 years
    The correct directory is cd ~/.config/sublime-text-3/Packages. Then it works.
  • Vijay Kumar Kanta
    Vijay Kumar Kanta about 5 years
    Just making sure the case is perfect, otherwise they won't show up. Waiting is important too.
  • Vikas Kandari
    Vikas Kandari about 5 years
    Thank you this one was easy you should be on top
  • Timothy.Li
    Timothy.Li over 3 years
    If you want to see the loading process of the plugin(typescript), select "View" menu, and click "Show console", and you may "Hide console" when you don`t want to see it anymore.
  • neaumusic
    neaumusic about 3 years
    I had to CMD+Q and restart Sublime for mouse hover and checking to work
  • squarebrackets
    squarebrackets almost 3 years
    If "Goto Definition" does not work, you may need to reinstall the TypeScript plugin.