As the title says, in visual studio code you can use the editor.action.joinLines to join different lines of text to one single line? Being an editor noob, the question is how? How do I map this command to a key board short cut, or what mouse actions do I need to do after selecting the said text, to get two different lines as one single line? Specifically I am working on Mac OS X.
2 Answers
To join several lines you have to select them first (you can read more about various ways of selecting text in the vs code documentation) and then invoke the Join Lines command. As a result, all text from the second and next lines will be appended to the end of first lines.
You can invoke the Join Lines command either from the Command Palette by pressing F1 or ⇧+⌘+P on macOS and typing Join Lines or by pressing the assigned shortcut - ⌃+J
Comments
You can also configure your own key bindings by clicking File>Preferences>Keyboardshortcuts on Vscode main menu. There you can bind the command joinLines to your prefered Keyboard keys as shown in this link. View image
