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

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

125100 次浏览

Select your code =>

Select your code => F1 => "Join Lines"

F1 => "Join Lines"

You can also create a keyboard shortcut for this command editor.action.joinLines

You can also create a keyboard shortcut for this command editor.action.joinLines

Default shortcut on Mac is Ctrl+J

Default shortcut on Mac is Ctrl+J

It seems vscode's "Join Lines" keyboard shortcut in macOS is ctrl + j:
enter image description here

It seems vscode's "Join Lines" keyboard shortcut in macOS is ctrl + j:
enter image description here

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

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