Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have one tab with a vertical split view of a file in VSCode while other tabs just have one file?

In Visual Studio Code I can split the view and see two areas of the same file side-by-side.

But then I seem to have two views from then on. Each side has a number of tabs to choose from. So I can switch between files in either half.

But what I actually want is to switch between that view with the two parts of one file, and other views that are plain old single views of any of the other files.

Is this also possible? It seems to be more what I was used to in other editors before I started using VSCode.

like image 400
hippietrail Avatar asked Oct 30 '25 12:10

hippietrail


1 Answers

That functionality is currently being worked on in the Insiders' Build v1.61 - presumably in Stable early October, 2021.

It is currently limited to 2 views into the same file.

In the commands that follow or in the editor tabs' context menu: Split In Group and Join in Group. See Issue: Allow to split an editor into two without creating separate tabs. It is a little buggy right now though, but promising.

View: Split Active Editor in Group
workbench.action.splitEditorInGroup

View: Join Active Editor in Group
workbench.action.joinEditorInGroup

split in group demo


Whether the split is vertical or horizontal is controlled by this setting:

split in group direction setting


The border between the two views into the same file can be styled with this setting:

"workbench.colorCustomizations": {
   
  "sideBySideEditor.border": "#0400ff"
}

See v1.61 release notes: splitting an editor

workbench.action.splitEditorInGroup
workbench.action.toggleSplitEditorInGroup
workbench.action.joinEditorInGroup
workbench.action.toggleSplitEditorInGroupLayout

A new setting workbench.editor.splitInGroupLayout allows to set the layout for splitting to be either vertical or horizontal.

A bunch of new commands allow to use this new feature via keybindings:

  • workbench.action.splitEditorInGroup
  • workbench.action.toggleSplitEditorInGroup
  • workbench.action.joinEditorInGroup
  • workbench.action.toggleSplitEditorInGroupLayout
like image 96
Mark Avatar answered Nov 01 '25 07:11

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!