How vscode compact multiline to a singleline?

2020-05-21 07:15发布

I have 4 lines like this in vscode:

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

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

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

2条回答
男人必须洒脱
2楼-- · 2020-05-21 07:49

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

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

Default shortcut on Mac is Ctrl+J

查看更多
Emotional °昔
3楼-- · 2020-05-21 08:08

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

查看更多
登录 后发表回答