17

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 Parsa Manesh
  • 2,314
  • 3
  • 16
  • 32

1 Answers1

61

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,711
  • 1
  • 25
  • 35