Reputation: 215
I am looking for a formatting/indetation tool for sublime text 2, which on ctrl+s
turns the following code
if(a==2){b=a+2;}
to something like
if(a == 2) {
b = a + 2;
}
I can't find anything useful. Please help.
Upvotes: 1
Views: 22218
Reputation: 215
I have worked around an easy solution for my code indentation/formatting problem. I am using an online formatting tool JSBeautifier. I just copy my whole code and paste it in jsbeautifier and after it formats my code I copy my formatted code and paste it back to my js file.
Upvotes: -10
Reputation: 3823
CoolFormat offers various bracket, indentation, whitespace, & formatting styles for the following langauges:
C
, C++
, C#
, CSS
, HTML
, Java
, JavaScript
, JSON
, Objective-C
, PHP
, SQL
, XML
Upvotes: 2
Reputation: 5256
You can use JsFormat
JsFormat is a JavaScript formatting plugin. Behind the scenes, it uses the command line formatter from jsbeautifier.org to format full or portions of JavaScript and JSON files.
Upvotes: 7