Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: How to Split Editor Vertically

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?

like image 935
RainingChain Avatar asked Nov 20 '16 21:11

RainingChain


People also ask

How do I split a window vertically in Visual Studio?

If you want to split the same class: Tools -> Options -> Environment -> Keyboard -> search by Window. Split and add a new shortcut. Show activity on this post. In visual Studio 2015 right click tab part where file name is written and select vertical split or horizontal split.

How do you select vertically in VSCode?

Keyboard shortcut for vertical block selection: To select code block vertically in your visual studio code, use Shift + Alt and then use the mouse to select lines vertically, from top-left to bottom-right.


2 Answers

Change editor split layout from horizontal to vertical

In 1.20

  • ALT+SHIFT+0 PC (Windows, Linux)
  • ++0 Mac

Pre-1.20

  • ALT+SHIFT+1 PC (Windows, Linux)
  • ++1 Mac

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

In 1.58.2 **

** Someone update this with the lowest version where this became true.

  • The menu entry with the shortcut given above is View=>Editor Layout=>Flip Layout
  • The Command Palette entry is labeled "Toggle Vertical/Horizontal Editor Layout"
  • The settings entry is
    {   "key": "alt+cmd+0",   "command": "workbench.action.toggleEditorGroupLayout" } 
like image 124
v-andrew Avatar answered Sep 28 '22 00:09

v-andrew


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.

Visual Studio Code - toggle editor group layout button

like image 43
Lance U. Matthews Avatar answered Sep 27 '22 23:09

Lance U. Matthews