How to make vscode compact multiple lines to a single line?

Viewed 114458

I have 4 lines like this in vscode:

1 line;
2 line;
3 line;
4 line;

Does vscode have a shortcut that can quickly compact 4 lines to 1 line like this:

1 line; 2 line; 3 line; 4 line;

4 Answers

I also had same issue and solved it. If you use Prettier, try it as below.

Settings -> Prettier.printWidth" 

The default value is 80. If you change this value higher than 80.

Or you could use these two in vs code.

Fold multiple lines: ctrl + shift + [ Unfold multiple lines: ctrl + shift + ]

I prefer these because I want to use prettier as well.

Related