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!

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

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