Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile and Run Coffeescript in Sublime Text 2

Has anone had any luck both compiling and running CoffeeScript files in Sublime Text 2 with the TextMate bundle https://github.com/jashkenas/coffee-script-tmbundle

CoffeeScript.sublime-build

{
"path": "/usr/local/bin",
"cmd": ["coffee","$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.coffee"
}

Anyway to enable both the compile and compile selected text commands in Sublime Text 2?

like image 812
pruett Avatar asked May 17 '12 21:05

pruett


3 Answers

Multiple builds were added in 2197 http://www.sublimetext.com/forum/viewtopic.php?f=2&t=7180

like image 107
atomi Avatar answered Sep 25 '22 12:09

atomi


If by "multiple build commands" you mean to pass different compile options to CoffeeScript you can check out this blog post to see how I did it:

http://hectorcorrea.com/Blog/Compiling-CoffeeScript-from-Sublime-Text-2

Basically I implemented on using the same approach that you did (via the Build menu) and the remaining I had to implement with plugins.

The answer by @atomi indicates that this will be supported natively soon which would be very nice.

like image 26
Hector Correa Avatar answered Sep 24 '22 12:09

Hector Correa


The setup here looks pretty promising. Evidently you can bind a key combo to a command, in this case just running coffee on the file.

http://soenkerohde.com/2011/11/coffeescript-with-sublime-text/

like image 45
hvgotcodes Avatar answered Sep 24 '22 12:09

hvgotcodes