Repository navigation
Description
VsCode has the ability to horizonatally split an editor window. When you execute code --diff file1 file2 both files are opened side by side in a single editor window with a single header tab. A similar view is presented when you edit the VsCode settings.
This is splitting. It would be nice to be able to do this for my own files to have multiple views of the same file. What would make it actually usable would be the following three enhancements.
- The option to split either horizontally or vertically.
- The ability to move focus from one split pane to another.
- The ability to unsplit (revert the editor back to a single pane).
What we currently have is a keyboard shortcut "workbench.action.splitEditor" which doesn't actually split an editor at all, instead it just opens the same file in another editor in a different editor group. This is not editor splitting which by definition should occur in the same editor tab.
Calling opening a file in another editor group 'splitting' when there is already nascent functionality to support proper splitting is a pointless ambiguity that serves only to reduce the possibility that the editor will ever support proper splitting any time in the near future.
Proposal:
- Rename "workbench.action.splitEditor" to "workbench.action.openInNewEditorGroup"
- Make the VsCode diff view usable by adding a keyboard shortcut to permit cycling focus from one editor pane to the other.
- Add support to split open editor vertically or horizontally by the addition of the additional keyboard shortcuts "editor.action.splitHorizontal", "editor.action.splitVertical" and "editor.action.unsplit".
Activity
Neutrino-Sunset commentedon Oct 22, 2017
I found the discussion about enhancing the editor group functionality here
#5911
...and added some thoughts of my own about how grouping and splitting should be two separate things which it might be useful to reiterate here.
Faultless commentedon Oct 22, 2017
+1
Horizontal splitting is a really frustrating experience in vscode. And apart from git diffing, it ends up being more of an annoyance (misclick) than an actual feature.
Sent from my Samsung SM-A500H using FastHub
[-]Rationalize editor splitting functionality.[/-][+]Allow to split an editor into two without creating separate tabs[/+]robertocarta commentedon Mar 4, 2018
+1 This is the only reason why I'm unable to switch from vim to vscode. The idea is that you want to be able to split a tab, not the entire editor.
For example, I want one tab vertically split with index.html and controllers.js, and another tab split between directives.js and somethingelse.whateva.
smbkr commentedon Dec 18, 2018
This workflow would make sense to me as well. I work in Vim the same way that robertocarla describes. I like to work with implementation and tests side by side, and switch tabs to switch to a different implementation/test pair.
It's also disruptive opening a git diff when you have got a split view open, as the diff opens in one side of the split only, but splits it in half again. Ideally, opening a git diff would open a new tab (a blank canvas with no splits), splitting that in two vertically.
smbkr commentedon Dec 18, 2018
There are some other (now closed) issues not referenced here that are requesting the same feature, just to indicate that there is a healthy demand for this: #7418
#49062
#41486
56 remaining items
[-]Allow to open two editors side by side in one group[/-][+]Allow to open two distinct editors side by side in one group[/+]heartacker commentedon Sep 14, 2021
open setting config with split view, then use ctrl+kctrl+shift+\and the split view is closed into one, but trigger that again, we couldn't recover the split setting view,
heartacker commentedon Sep 15, 2021
click setting file will create new-two-tab-view even opened

bpasero commentedon Sep 15, 2021
heartacker if you see any issues specific to settings, please report as new issues and make sure to try this out in insiders. You can give our preview releases a try from: https://code.visualstudio.com/insiders/
ted1030 commentedon Sep 25, 2021
I hope this feature can also be used when we move the terminal to the editor area.
ChugunovRoman commentedon Oct 28, 2021
Benjamin Pasero (@bpasero) Hi. Is the split an editor without creating a new group feature available for plugins? Can a plugin use this feature for creating own UI inside a splited tab?
bpasero commentedon Oct 28, 2021
There is no official API, though arguably an extension could open an editor and then trigger the
workbench.action.splitEditorInGroupcommand right after.veryjos commentedon Jan 18, 2022
I'm a little confused, is this being dropped? The issue title changed to something different, and I can't find the original ask tracked somewhere else.
But just to recap, because this issue is getting huge and confusing to me:
For most vim users, this is an intrinsic part of the workflow for stuff like having an impl/test side-by-side, and maybe you open a third split for like, an HTML template or stylesheet.
Then, those 3 splits are grouped together in one tab. So when I want to think about "ComponentX", I just navigate to that tab and see everything at once. Maybe even a 4th split for documentation.
I think multiple editors solves all of this, but the missing piece is grouping them into a single tab.
One way to solve this might be to introduce an optional, higher-order tab bar where each tab groups editor splits, and then provide an option to disable the tab bar inside the editors.
But anyway, I understand that's probably a lot of effort. I hope the original feature request is still tracked somewhere, though.
a-stewart commentedon Feb 11, 2022
I think this is something that would be really useful, especially if it could be controlled via an extension.
For example, we often use two editor groups for doing side-by-side previews (eg markdown). But that is usually no what is wanted as when you click onto another editor tab, the preview is still taking up half the screen.
It would be great if extensions could split an editor in half, and then put a webview into the other half.
Very hacky demo:

aggrhm commentedon Feb 14, 2022
It definitely feels like the Code team prefers this functionality be implemented as an extension, and this is pretty much exactly what my extension "Workviews" (https://marketplace.visualstudio.com/items?itemName=agquick.workviews) does, except the "tabs" are shown in the Explorer pane on the left.
The problem is I can't get access to all the open editors/terminals/etc properly until VS Code decides to open up the extension APIs a bit. But it's the closest feeling to VIM I've been able to achieve thus far.
a-stewart commentedon Feb 16, 2022
I think that is slightly different to what is being asked for here. (The post above is a demo of what could be done with the functionality, not what we are asking for explicitly.)
This FR is asking for a way for extensions to control the "Split Editor in Group" functionality and specify what is rendered in the other half of the editor. At the moment it is not possible for extensions to do that.
thefakeplace commentedon Feb 16, 2022
If you gather context from reading the thread, it's likely that most of the support for this FR is from Vim users who have a workflow based on grouping multiple editors within tabs. They've been punted here from other FR's that are closed as duplicates of this FR.
In my opinion, the main issue is that tabs don't group anything. One-to-one correlation between tabs and files, except in some special cases, like the diff view.
Creating another grid inside the existing editor grid seems like the wrong way to solve the problem to me-- especially if the new grid is subject to limitations like only horizontal splitting + showing the same file.
See #143024 for an alternate solution that solves everyone's problem.
starball5 commentedon Jul 6, 2023
Related on Stack Overflow: Is it possible to create split editors inside individual tabs in VS Code?. I'll keep my answer post updated with whatever progress is made here.