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

JS2​Coffee

by aziz ST2/ST3

No description provided

Details

  • 1.0.0
  • github.​com
  • 4 years ago
  • 2 hours ago
  • 6 years ago

Installs

  • Total 5K
  • Win 1K
  • OS X 3K
  • Linux 1K
Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11
Windows 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 2 0 0 1 0 0 1 0 0 0 0
OS X 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 2 0 1 0 0 0 0 0 2 0 0 0 1 1 0 1 0 0 1 1 0 3 1 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 1 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 1

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:

image

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).

image

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.