3

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 2

6

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.

enter image description here

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.