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

Es​Formatter

by piuccio ST2/ST3

JavaScript formatter plugin for Sublime Text

Details

  • 2.0.2
  • github.​com
  • github.​com
  • 11 months ago
  • 24 minutes ago
  • 4 years ago

Installs

  • Total 13K
  • Win 6K
  • OS X 5K
  • Linux 2K
Jun 27 Jun 26 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
Windows 8 12 4 1 3 4 7 4 5 2 4 7 4 5 4 7 1 2 12 4 10 5 10 6 2 6 8 7 3 5 5 1 5 5 8 7 6 3 4 6 4 6 7 5 3 3
OS X 4 2 2 2 3 4 13 5 5 0 3 3 5 5 3 4 1 0 10 2 6 6 1 0 1 8 3 6 2 7 2 1 1 3 4 7 3 1 4 1 6 7 4 4 1 3
Linux 1 4 0 2 0 0 1 1 1 0 2 3 2 3 2 2 1 1 1 1 0 3 3 2 0 3 0 3 4 0 1 0 0 1 3 3 1 0 0 0 4 2 2 1 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime EsFormatter - Sublime Text Plugin

Sublime EsFormatter is a JavaScript formatter plugin for the text editor SublimeText 2/3.

It is based on esformatter, an extremely configurable JavaScript formatter.

Unlike other beautifiers it gives complete control over the coding style.

Requirements

You MUST have Node.js installed globally and included in your $PATH.

You can either install esformatter globally or under your current project's node_modules folder. This complicates the setup slightly but you can configure things anyway you want.

npm install -g esformatter

Installation

Using Sublime Package Control just search for

EsFormatter

Manual installation

This is not recommended, but if you know what you're doing, go on:

Clone this repository or download and unzip inside

Mac

  • ~/Library/Application Support/Sublime Text 3/Packages/EsFormatter

Windows XP

  • C:\Documents and Settings\<user>\Application Data\Sublime Text 3\Packages\EsFormatter

Windows 7 * C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages\EsFormatter

Linux

  • ~/.Sublime Text 3/Packages/EsFormatter

Usage

The default keyboard mapping is ctrl+alt+f or cmd+alt+f (that is super+alt+f).

You can change the key binding at: Sublime Text -> Preferences -> Package Settings -> EsFormatter -> Key Bindings - User.

{
  // ES Formatter key binding
  "keys": ["ctrl+alt+f"], "command": "esformatter"
}

If you are using a custom keyboard mapping, you may want to add the following line in order to restore the Replace Panel default functionality.

{ "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },

You can also run EsFormatter automatically when saving a file: Sublime Text -> Preferences -> Package settings -> EsFormatter -> Settings - User.

{
    // Format the file when saved
    "format_on_save": false
}

Configuration

You can configure the options from .esformatter file, either in your project on globally in your home directory.

Refer to the configuration of esformatter

Contribute

The python script simply calls the global version of esformatter. Make sure your changes work on all platforms.