Sublime Forum

CSS closing bracket indentation

#1

Hi, just installed latest Dev build to try out Sublime Text. So far it’s looking great!

Had 1 question (for now) about CSS bracket indentation.

Is it possible to change how they auto-ident?

Right now, this is the default behavior:

#navigation { display:block; }
I’d like the closing bracket to have a tab in front, so my css can looks like this, without having to add a tab in front of the } myself everytime.

#navigation { display:block; } #navigation ul { display:inline-block; } #navigation li { float:left; }

0 Likes

#2

I also prefer this style of code.

[size=150]+1[/size]

0 Likes

#3

sublimator,
Thanks!

0 Likes

#4

Thanks! :smiley: Took me a while to figure out how to use this, since I’ve only been used ST2 for a few hours, but it works fine. I’ve changed the key from alt+enter to enter since I always want it to behave this way for CSS. I was just wondering if that could cause any problems with other code (html or php for example)? Or does this apply to CSS only?

I’ve also just noticed a slight problem when deleting a line. If I have for example:

#breadcrumbs li { float:left; padding:2px 10px; outline:1px solid rgba(0,0,0,0.2); }
and delete the 3rd line, the closing bracket get moved back, resulting in:

#breadcrumbs li { float:left; padding:2px 10px; }
Any easy way to prevent that?

0 Likes