The question is, how do I move the selected block of code by one or several tabs, but not to the right (which is done by selecting a code and pressing Tab key), but to the left? Without selection each line one by one and deleting whitespace?
Moving parts of code from one place to another with differences in indent levels is a bit hard without knowing the shortcut.
What I mean (Imgur)
Thanks!
SHIFT + TAB move the selected text left.
Highlight the block of code and press "Tab" key or press space 4 times. If you want to move it to the left, then hold down the Shift key and press "Tab" key.
Select the code you wish to sort in Visual Studio Code. Then hit the key combination Ctrl+P and type the greater than sign ( > ). Next type sort and choose Sort Lines Ascending or choose the Descending option. Now the lines you've previously selected will be sorted by the option you chose.
For what you want,
Shift+Tab
should do the trick. However, I would like to recommend this extension which I find easier to use when formatting blocks of text: Indent One space
Note however this extension only indents selections by exactly one space, forward or backwards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With