0

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.

munchschair
  • 1,593
  • 3
  • 19
  • 43

2 Answers2

0

I mean, you could use the simple thing. Just a find and replace regex. Try something simple like:

\..*{

Then you can just use the multicursor trick and then add a new line wherever you like :).

user2662833
  • 1,005
  • 1
  • 10
  • 20
  • Think you can explain this more? I am not totally following you here. – munchschair Aug 02 '16 at 01:07
  • If you go to the find and replace window in brackets, you should see a symbol that looks like `.*`. That indicates that you can use regex to search. You can find all instances and then add blank lines. – user2662833 Aug 02 '16 at 01:37
  • \..*{ highlights the class before it as well. Also, what is the multicursor trick? I downloaded brackets just to do this. – munchschair Aug 02 '16 at 01:59
0

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.

munchschair
  • 1,593
  • 3
  • 19
  • 43