Sublime Forum

Indent Square Brackets

#1

Hello everyone.

I’ve been missing several days, searching and testing codes to get ST3 auto indenting the brackets [] in JavaScript, as it does with braces {}.

The plan was to code with ST3, review with VSC. But if I can’t solve this, I’ll keep VSC for everything.

I have JSON code embedded within the JavaScript code. I need to indent the square brackets [], JSON style, but within my JavaScript code.

Image from ST3

ST3 indent the square brackets [] correctly if the file is pure jSON.

Specifically I need to do this automatically in JavaScript, when I press enter in each pair []:

In this example, the automatic indentation of Sublime Text is bad, for [] and (), so bad it works, that I have to do it manually.

Image from ST3

Regards

0 Likes

#2

So what’s the input and expected output?

People love screenshots but hate to OCR them and then type by their own hands.

0 Likes

#3
1 Like

#4

Why not make a PR :slight_smile:

0 Likes