Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VS Code is the an opposite command from join lines? Like, expand lines?

How to expand a line of code? For example join lines command will do this

before

{
  a: 123,
  b: 321
}

after

{ a: 123, b: 321 }

And I need to do the opposite,

from this

{ a: 123, b: 321 }

to this

{
  a: 123,
  b: 321
}

Is there a way to do it? Maybe a plugin? Thanks.

like image 732
Open up Avatar asked Nov 07 '18 09:11

Open up


People also ask

What is command line in VS code?

Visual Studio Code has a powerful command-line interface built-in that lets you control how you launch the editor. You can open files, install extensions, change the display language, and output diagnostics through command-line options (switches).

How do you go one line down in VS code?

If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up. If you use the Alt+Down Arrow keys, the line of code selected moves down.


1 Answers

Using the example you provided you could use the splitline plugin https://marketplace.visualstudio.com/items?itemName=chenzhe.split-line

I noticed the example you provided wasn't valid JSON (missing quotes). If it was, or was any other valid type of code you could use the built VS code code formatter:

  1. Press Ctrl/Cmd + Shift + p
  2. Select >Format Document
like image 81
distantkey Avatar answered Oct 11 '22 11:10

distantkey