13

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>
bahman parsamanesh
  • 2,194
  • 3
  • 13
  • 31

1 Answers1

53

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.

leopal
  • 4,238
  • 1
  • 27
  • 33