Sublime auto indent children
Asked Answered
F

1

12

Often I come to the same problem,

If I need to add a wrapper (another element to wrap elements), I have to manually select the children tab them etc...

I was wondering is there anything out there for sublime text 3, to recognise that you are indenting a parent, therefore all children should be indented automatically ?

Edit I feel stylus, less and other tab based hierarchy language could suffer from the same symptoms.

Cheers.

Favoritism answered 27/11, 2013 at 10:56 Comment(0)
F
15

There's "Expand selection to indentation" to select lines with the same indentation level. The default keyboard shortcut is Ctrl+Shift+J.

To add a wrapper:

  • move the cursor to the first child
  • hit Ctrl+Shift+J to expand the selection
  • indent with Tab or Ctrl+]
  • hit to move the cursor above the selection
  • hit Ctrl+Enter to insert a new line

enter image description here

Flouncing answered 16/12, 2013 at 15:56 Comment(2)
I think, I would have to accept this answer :) thanks... very nice Image btwFavoritism
The key combos look quite cryptic, an image is much easier to understand :) You could also record a macro if you need this frequently.Flouncing

© 2022 - 2024 — McMap. All rights reserved.