12

I am looking for a way to give multiple line spacings or reduce spacing.

for ex:

<ul>
    <li>
    </li>
    <li>
    </li>
</ul>

becomes:

<ul>
  <li>
  </li>
  <li>
  </li>
</ul>
haneulkim
  • 4,406
  • 9
  • 38
  • 80

7 Answers7

21

You can select all and use SHIFT+TAB to unindent.

Matt
  • 2,063
  • 1
  • 14
  • 35
  • Yeah I know that but I want to give it 2space instead of indent – haneulkim Apr 09 '19 at 23:47
  • 2
    You’ll need to remove the indents and then change the formatting settings to change your indentation from a tab to 2 spaces. See https://stackoverflow.com/a/29972553 – Matt Apr 09 '19 at 23:54
7

you can select multiple line then -> use Tab key for adding space -> use Shift + Tab keys for deleting space from beginning of line in VS code

=>for multiline at same time you can use Shift + Alt + Up/Down arrow key then edit your code or remove/add space.

=>you can edit more then one line at same time in anywhere in code press and hold Alt key then click on lines with mouse. you can edit the text at same time in different lines with different indent.

Akshay Nayka
  • 336
  • 2
  • 7
7

There was a feature request for that in vscode repo. But it was marked as extension-candidate and closed. So, here is the extension: Indent One space

Install it, and select the area which you want to put space/tab at once and press space or tab button accordingly.

enter image description here

Yogendra
  • 504
  • 5
  • 13
2

Using VScode you can do it following way:

  1. Select all text you want to indent.
  2. Press Shift +Alt + i keyboard shortcut.
  3. Press Home Button.
  4. Add your ident.
Eddgar0
  • 21
  • 2
0

If you only want to change these several lines, maybe find & replace could help you. find tabs and replace them with two spaces. Don't forget to check "find in selection" or Alt+L.

David H. J.
  • 340
  • 2
  • 12
0

In VSCode the easiest way to add line space by this 2 steps.

  1. Add cursors to the line ends by using Shift + Alt + I short cut

  2. Press Enter Key.

    Useful when you are writing Github Readme.md or other Markdowns...

    Before: (You will see 3 file names as single sentence)

    Beginning Git and GitHub A Comprehensive Guide to Version Control.pdf Beginning XSLT and XPath.pdf Business Intelligence Data Mining.pdf

    After:

    Beginning Git and GitHub A Comprehensive Guide to Version Control.pdf

    Beginning XSLT and XPath.pdf

    Business Intelligence Data Mining.pdf

0

For MAC Latex users in OVERLEAF I just found that with fn+tab you can add indentations to all rows marked and with shift+tab you can erase back indentations

Marco Rmz
  • 1
  • 1