Search code examples
syntaxsasseditorbracketscurly-brackets

How do I change the style of brackets for a large document?


I'm using a large SCSS document. It's very large.

Currently the style looks like this:

.class {
    #inner {
        h5 {

        }
    }

}

I want it to look like this, I find it much easier to read:

.class
{
    #inner
    {
        p
        {

        }
    }

}

I can't just change it by hand. I have no problem using my editor to change the most outer class. But the editor won't pick up the nuances of the white space. Is there anything I can do? Note how the left brackets get indented and drop below the start of the class.

** Note, not every opening bracket simply needs just a line break, but also indentation to the right. The selectors can be ids, classes, tags, etc.


Solution

  • I ended up doing most of it by hand.

    But some of it I used regex that looked like this:

    {\n\t\t\t

    For the new lines and tabs after it.