VSCode: How to Split Editor Vertically

2019-01-21 00:01发布

问题:

In Visual Studio code, a while ago, when I used View->Split Editor, it would split vertically. (One file on the left and one file on the right.)

I updated Visual Studio Code and when when I do View->Split Editor, it always splits horizontally. (One file on the top and one file on the bottom.)

How can I split vertically?

回答1:

In 1.20

ALT+SHIFT+0 PC (Windows, Linux)

++0 Mac

Pre-1.20

ALT+SHIFT+1 PC (Windows, Linux)

++1 Mac

Changes editor split layout from horizontal to vertical

In 1.25 you can split editor into Grid layout. Check View=>Editor Layout

It is nicely presented in Release notes v1.25: VS Code grid editor layout



回答2:

If you're looking for a way to change this through the GUI, at least in the current version 1.10.1 if you hover over the OPEN EDITORS group in the EXPLORER pane a button appears that toggles the editor group layout between horizontal and vertical.



回答3:

Press CMD + SHIFT + P (MAC) and search for Toggle Editor Group



回答4:

In version 1.23.1, it is Ctrl+Shift+P and Split Editor This will divide the screens vertically and you can move through them using Ctrl+K+LeftArrow



回答5:

To change the editor in Landscape and Vertical mode, follow the steps below.

  1. For example, open two files that you have in your left or right side bar, depending on where you are placed. By default it is always on the left.

  2. Now that you have both windows open, you have to use the key combination for PC (Alt + Shift + 1) for (Windows and Linux Operating Systems) or for MAC (Cmd + Option + 1), as commented here v-andrew.



回答6:

The key bindings has been changed with version 1.20:

SHIFT+ALT+0 for Linux.

Presumably the same works for Windows also and CMD+OPT+0 for Mac.



回答7:

I just found a simple solution. You can drag an opened file and move towards the four sides of the Editor, it will show a highlighted area that you can drop to. It will split the view automatically, either horizontally, vertically, or even into three rows.

VSCode v1.30.2