Home Download Buy Blog Forum Support

apply indenting in Sublime?

apply indenting in Sublime?

Postby sonicraf on Sat Nov 24, 2012 4:18 pm

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
sonicraf
 
Posts: 2
Joined: Sat Nov 24, 2012 4:14 pm

Re: apply indenting in Sublime?

Postby vitaLee on Sat Nov 24, 2012 4:35 pm

check if Edit->Line->Reindent works for you
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: apply indenting in Sublime?

Postby sonicraf on Sat Nov 24, 2012 4:49 pm

vitaLee wrote:check if Edit->Line->Reindent works for you


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!
sonicraf
 
Posts: 2
Joined: Sat Nov 24, 2012 4:14 pm

Re: apply indenting in Sublime?

Postby bronson on Wed Nov 28, 2012 9:14 pm

Reindent seems useless on JSON files.

For example, it changes this:

Code: Select all
[
]


to this:

Code: Select all
    [
]


and this:

Code: Select all
[
  { "keys": "zed" },
]


to this:

Code: Select all
[
{ "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?
bronson
 
Posts: 38
Joined: Wed Nov 28, 2012 8:52 pm


Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests

cron