Home >Development Tools >sublime >How to make Sublime Text2 support CoffeeScript
The following tutorial column of sublime text will introduce to you how to enable Sublime Text2 to provide support for CoffeeScript. I hope it will be helpful to friends in need!
1. Provide syntax highlighting
Download CoffeeScript.tmLanguage
Save in C:\Users\youName\AppData\Roaming\ Under Sublime Text 2\Packages\CoffeeScript (you need to make one yourself)
Then you can select coffeeScript in the lower right corner...Is it lit?
2. Provide Build support
Select Tools -> Build System -> New Build System...
Copy the following content in the menu bar and save it to the default In the User directory, name it coffee (this will allow you to easily find it in Tools -> Build System)
{ "cmd": ["coffee.cmd","-c","$file", "&&", "coffee.cmd","$file"], "selector": "source.coffee" }
Test it:
Save it as .coffee
console.log 'Hello,World!'
CTL B executes the script and gets the following output:
Hello, World!
For more sublime related technical articles, please visit the sublime column: //m.sbmmt.com/tool/ sublime/
The above is the detailed content of How to make Sublime Text2 support CoffeeScript. For more information, please follow other related articles on the PHP Chinese website!