Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Multi-line code to single line in Visual Studio Code in Ubuntu [duplicate]

Is there any shortcut to convert multi-line code to single line in VS Code 2018 (version 1.23) in Ubuntu.

For example convert this :

<label class="container-of-label">
  <input type="checkbox" class="dataTable-checkBox">
  <span class="checkmark"></span>
</label>

to :

<label class='container-of-label'><input type='checkbox' class='dataTable-checkBox'><span class='checkmark'></span></label>
like image 284
bahman parsamanesh Avatar asked Jul 25 '18 07:07

bahman parsamanesh


People also ask

How do you duplicate the same line in vs code?

Duplicate line. You can make the duplications of the same line using: Mac — Command + Shift + D. Windows/Ubuntu — Ctrl + Shift + D.


1 Answers

Mark code that you want to convert to single line, press F1, type join lines press Enter and voila!

You may also want to assign a keyboard shortcut for this operation. Search for Join lines in keyboard shortcuts list and assign the desired shortcut.

like image 55
leopal Avatar answered Oct 08 '22 06:10

leopal