Home Download Buy Blog Forum Support

CSS closing bracket indentation

CSS closing bracket indentation

Postby DeeLight on Thu Jul 28, 2011 5:56 am

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:

Code: Select all
#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.

Code: Select all
#navigation {
    display:block;
    }
    #navigation ul {
        display:inline-block;
        }
        #navigation li {
            float:left;
            }
DeeLight
 
Posts: 3
Joined: Thu Jul 28, 2011 5:40 am

Re: CSS closing bracket indentation

Postby ilya on Thu Jul 28, 2011 6:09 am

I also prefer this style of code.

+1
ilya
 
Posts: 122
Joined: Fri Sep 11, 2009 8:32 pm

Re: CSS closing bracket indentation

Postby ilya on Thu Jul 28, 2011 6:47 am

sublimator,
Thanks!
ilya
 
Posts: 122
Joined: Fri Sep 11, 2009 8:32 pm

Re: CSS closing bracket indentation

Postby DeeLight on Fri Jul 29, 2011 3:15 am

Thanks! :D 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:

Code: Select all
#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:

Code: Select all
#breadcrumbs li {
    float:left;
    padding:2px 10px;
}

Any easy way to prevent that?
DeeLight
 
Posts: 3
Joined: Thu Jul 28, 2011 5:40 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], jbrooksuk, Yahoo [Bot] and 28 guests