Home Download Buy Blog Forum Support

CoffeeScript

Re: CoffeeScript

Postby TrevorBurnham on Thu Aug 11, 2011 3:53 pm

Thanks, jps! That did indeed give me the comment toggling and indentation support that I craved. Now if only someone who's handier with Python than I am would write a plugin to provide Build/Run functionality that works on both whole files and selected text, like in the TM bundle...
TrevorBurnham
 
Posts: 6
Joined: Sun Jul 24, 2011 5:49 pm

Re: CoffeeScript

Postby pgherveou on Thu Nov 03, 2011 9:52 am

for #1 I created a small build file

{
"cmd": ["coffee", "-p", "$file"],
"selector" : "source.coffee",
"path" : "/usr/local/bin"
}

but this compile the entire file I couldn't find a way to make it work just for highlighted text, which I find much more useful

Also, I noticed there is no syntax highlighting for variables when u use string interpolation "#{foo}bar" foo and bar are the same color

Is there a way in sublime to set the default file type to coffeescript for example so I can get syntax highlighting before saving the file ?
pgherveou
 
Posts: 3
Joined: Tue Sep 20, 2011 9:40 am

Re: CoffeeScript

Postby tretretre on Sat Nov 05, 2011 9:17 pm

pgherveou wrote:Is there a way in sublime to set the default file type to coffeescript for example so I can get syntax highlighting before saving the file ?


Take a look here: http://www.sublimetext.com/forum/viewtopic.php?f=2&t=3639

You can also change the syntax highlight via the command palette. Just hit ctrl+shift+p and search for the language you want to use for syntax highlighting .
tretretre
 
Posts: 23
Joined: Fri Oct 21, 2011 7:13 pm

Re: CoffeeScript

Postby pgherveou on Mon Nov 07, 2011 8:38 am

Great, thks a lot I installed "default file type" through package control, I guess that one the one you were talking about,
Just need to find a way to compile just the highlighted text and sublime will be the perfect coffee editor for me !
One last thing is it possible to get text highlight in the build pane ?
pgherveou
 
Posts: 3
Joined: Tue Sep 20, 2011 9:40 am

Re: CoffeeScript

Postby phatmann on Mon Nov 07, 2011 2:05 pm

Thanks to all for the tips on getting Coffeescript highlighting to work. So nice to finally have this! For those coming to this topic for a how-to, I will sum it up here:

  1. Create a Coffeescript directory in the Sublime Packages directory.
  2. Download Coffeescript.tmLanguage and place in Coffeescript directory.
  3. Download Coffeescript.tmPreferences and place in Coffeescript directory.

The Sublime Packages directory can be found at:

Windows: %APPDATA%/Sublime Text 2/Packages
OS X: ~/Library/Application Support/Sublime Text 2/Package
Linux: ~/.Sublime Text 2/Packages
Portable Installation:Sublime Text 2/Data/Packages
phatmann
 
Posts: 2
Joined: Mon Nov 07, 2011 1:54 pm

Re: CoffeeScript

Postby meech on Mon Jan 23, 2012 1:36 am

I know I'm late to the party, thanks phatmann for the outlined instructions.

One problem I noticed is that auto indenting doesn't work in .coffee files. Is there something I can do to let Sublime know that the construct "->" represents a scope (as well as if, else, etc..)?
meech
 
Posts: 5
Joined: Sun Jan 22, 2012 3:43 pm

Re: CoffeeScript

Postby meech on Mon Jan 23, 2012 3:00 am

I'll answer my own question and address anyone else wondering how to get the entire CoffeeScript bundle working.

I extracted the entire contents of the TextMate bundle mentioned in this thread (https://github.com/jashkenas/coffee-script-tmbundle) into a CoffeeScript directory inside the Packages directory. This enabled all snippets and indenting issues I had.
meech
 
Posts: 5
Joined: Sun Jan 22, 2012 3:43 pm

Re: CoffeeScript

Postby backspaces on Fri Feb 21, 2014 2:38 am

Trevor: were you able to transfer to Sublime? Especially ST3?

I've got the problem that, within HTML using the coffee-script.js inline compiler, the HTML package does not use the CS package while editing the CS.
backspaces
 
Posts: 17
Joined: Tue Oct 22, 2013 4:03 am

Previous

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 7 guests