Sublime Forum

Apply indenting in Sublime?

#1

hi, new sublime user here.

i see a lot of talk about indenting configuration. so far i don’t see any issues with the way indenting is configured by default.

I am trying to figure out a way to apply indenting on a document im working on. let’s say i remove some parent node etc, i want to reformat current document… in visual studio there is a shortcut which applies indentation to current document. does something like that exist in sublime ? i couldn’t find it in manual

0 Likes

#2

check if Edit->Line->Reindent works for you

0 Likes

#3

so, this seems to work in html element, and on some javascript. for example the curly bracket got shifted, but a new line within a block that was shifted right, did not get re-aligned. maybe that’s part of configuration?
still, not sure how i missed this in the past, thanks!

0 Likes

#4

Reindent seems useless on JSON files.

For example, it changes this:


]

to this:

    
]

and this:


  { "keys": "zed" },
]

to this:


{ "keys": "zed" },
]

It uses no consistent style that I’m aware of, and is certainly not the style that’s used by sublime for its settings files.

Do I have something misconfigured?

0 Likes