JavaScript
Article
By Sam Deering

Javascript Beautifier Plugin with Sublime 2

By Sam Deering
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

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

--ADVERTISEMENT--

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!
Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?