BearPanther.com

Using jsformat with Sublime Text

Introduction

user

bear


LATEST POSTS

There are many d3 demos like this but this one is mine 08th June, 2014

CSS font property shorthand does what? 03rd June, 2014

JavaScript

Using jsformat with Sublime Text

Posted on .

I can be particular about how I like stuff formatted. JavaScript is no exception.

Since I use Sublime as my editor 98% of the time, I use jsformat to quickly clean up sloppy formatting. Installation is easy via package control.

By default, jsformat will only run against js files but you can change that by adding a custom key binding. Step-by-step: click the “Sublime Text” menu, then “Preferences” and select “Key Bindings – User”. In the file that opens, add:

{ "keys": ["ctrl+alt+f"], "command": "js_format"}

Once you’ve done that, press ctrl+alt+f anywhere and it’ll run jsformat. Slick. To drive it home, here’s a summary gif:
animated gif showing jsformat usage in sublime text

There are no comments.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

View Comments (0) ...