Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime auto indent children

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.

like image 837
Val Avatar asked Nov 27 '13 10:11

Val


1 Answers

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

like image 98
Stefan Avatar answered Dec 02 '22 20:12

Stefan