ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

JS2​Coffee

by aziz ALL

No description provided

Details

  • 1.0.0
  • github.​com
  • 10 years ago
  • 2 hours ago
  • 12 years ago

Installs

  • Total 5K
  • Win 1K
  • Mac 3K
  • Linux 1K
May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime JS2Coffee

A quick way to convert Javascript to Coffeescript without leaving Sublime Text 3.

Installation

then, either

  • Install Package Control if you don't already have it.
  • cmd-shift-p Package Control: Install Package -> JS2Coffee

or

  • Clone this repo into your Packages directory (Not Recommended: cloning will not allow you to update automatically).

Usage

cmd-shift-p JS2Coffee:

The syntax will be automatically set to CoffeeScript, and either the current file will be replaced with the CoffeeScript convertion, or a new file will be opened containing the conversion (depending on the command you used).

Settings

{
  "js2coffee_path": "/usr/local/bin/node /usr/local/bin/js2coffee",
  "coffee_syntax_path": "Packages/Better CoffeeScript/CoffeeScript.tmLanguage"
}

Bind a Key Combination

Note: Out of courtesy, there is no keyboard shortcut set by default.

In Packages/User/Default (your OS).sublime-keymap add one of the following lines:

  • { "keys": ["ctrl+shift+j"], "command": "js_coffee", "args":{"new_file": true}}

or

  • { "keys": ["ctrl+shift+j"], "command": "js_coffee", "args":{"new_file": false}}

Troubleshooting

If js2coffee outputs an error message it will show up in Sublime Text's console. There is not always useful context information in these messages, so YMMV.