JavaScript
Article

Javascript Beautifier Plugin with Sublime 2

By Sam Deering

Javascript Beautifier Plugin with Sublime 2 uses the the JavaScript formatting python module from jsbeautifier.org. The plugin is pretty basic at the moment, doesnt check to make sure you are in a .js file, it just formats the selected text, or the entire file if there is no selection.

More posts on Sublime 2:

Code Before

code-before

Select your code and the execute the command

Full instructions below.
format-function

Code After

after

Setup Instructions

  1. Download the sublime format plugin from GitHub.
  2. Type %appdata% in cmd (start>run) and extract the folder renamed to “JsFormat“.
  3. Reload Sublime 2
  4. Select the JavaScript you want to make pretty.
  5. Press CTRL+SHIFT+P (or Tools>Command Pallet) and select Format as the command.
  6. You should now have pretty JavaScript!

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.