haneulkim
haneulkim

Reputation: 4928

is there a shortcut on deleting/adding space of multiple lines in VScode?

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>

Upvotes: 15

Views: 80185

Answers (8)

Arunkumar Rajan
Arunkumar Rajan

Reputation: 11

Adding multiple lines in VS code: use the keys :

alt+shift+ up/down

Add space for multiple lines: use the keys:

tab

remove space for multiple lines: use the keys:

shift + tab

Upvotes: 0

Marco Rmz
Marco Rmz

Reputation: 11

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

Upvotes: 1

Eddgar0
Eddgar0

Reputation: 41

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.

Upvotes: 4

M M Kamalraj
M M Kamalraj

Reputation: 1

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

Upvotes: 0

Yogendra
Yogendra

Reputation: 534

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

Upvotes: 10

Akshay Nayka
Akshay Nayka

Reputation: 376

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.

Upvotes: 8

David H. J.
David H. J.

Reputation: 410

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.

Upvotes: 0

Matt
Matt

Reputation: 2213

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

Upvotes: 31

Related Questions