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

Es​Formatter

by piuccio ST2/ST3

JavaScript formatter plugin for Sublime Text

Details

Installs

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

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.