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

1

3

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.

Maureenmaureene answered 11/11, 2019 at 8:25 Comment(4)
Tabs exist within editor groups, and there is no ability (unless there is an extension) to have a split within an editor (compared to VS which can both have multiple editor groups with tabs and split an individual editor). So I think the answer is no.There
@Richard: Indeed you are right. I've done some digging and it turns out there's been a feature request for what I want open for two years: Allow to split an editor into two without creating separate tabsMaureenmaureene
I suspected there might be... a simple split of often useful so upvoted.There
Different views under one tab would make much sense for plugin oracle.oracledevtools: above view to edit SQLs, below view to show result set. They belong together and it's currently hard to keep them together.Nullification
P
8

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
Pisarik answered 9/9, 2021 at 3:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.