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;
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;
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
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.
For Windows
Just Install Sublime Keymapper extension in vscode.
Select Lines you want to be on single line then pressctrl + j
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.
Adding to @Alex answer ; better option is to bind a shortcut key to Join Lines e.g. Ctrl + Alt + h