Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to open two distinct editors side by side in one group #36700

Open
Neutrino-Sunset opened this issue Oct 22, 2017 · 53 comments
Open

Allow to open two distinct editors side by side in one group #36700

Neutrino-Sunset opened this issue Oct 22, 2017 · 53 comments
Labels
feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@Neutrino-Sunset
Copy link

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.

  1. The option to split either horizontally or vertically.
  2. The ability to move focus from one split pane to another.
  3. 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:

  1. Rename "workbench.action.splitEditor" to "workbench.action.openInNewEditorGroup"
  2. Make the VsCode diff view usable by adding a keyboard shortcut to permit cycling focus from one editor pane to the other.
  3. 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".
@Neutrino-Sunset
Copy link
Author

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.

My personal workflow is to open editors horizontally (side by side). Occasionally I may want to view two parts of the same file, which I do by splitting that editor vertically (one pane above the other). Splitting the file in the editor (as opposed to opening another vertical editor group) is a distinct useful feature because splitting one editor vertically does not half the height of all the other horizontally laid out editors you have open.

Suggesting that opening additional horizontal or vertical editor groups performs the same job as editor splitting is to completely misunderstand the problem. Suppose I have 4 editors laid out side by side and I want to split one editor vertically. If to do this open my file in another editor in a group below the existing editor group, then all the other editors in the first group are now halved in height.

This is why editor groups and editor splitting are two different things.

@Faultless
Copy link

+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

@bpasero bpasero added layout General VS Code workbench layout issues and removed workbench labels Nov 16, 2017
@bpasero bpasero added the feature-request Request for new features or functionality label Nov 17, 2017
@bpasero bpasero removed their assignment Nov 17, 2017
@bpasero bpasero changed the title Rationalize editor splitting functionality. Allow to split an editor into two without creating separate tabs Nov 17, 2017
@robertocarta
Copy link

+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
Copy link
Contributor

smbkr commented 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
Copy link
Contributor

smbkr commented 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

@ropieur
Copy link

ropieur commented Sep 3, 2019

I fully agree the description in this ticket. The current "split" functionality imposes a reduction of edition area to all other editors. This is not an editor split but a layout split.
I vote +1 for a real editor split feature

@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@mmmfarrell
Copy link

Vim-style splitting would be awesome! This is the cause of one of the few remaining efficiency decreases I get by switching to VSCode from Vim

@veryjos
Copy link

veryjos commented Apr 9, 2020

+1 for this, also a feature I'd like to see. I think there's quite a few users trying to migrate off vim that use this workflow!

@flux627
Copy link

flux627 commented Apr 22, 2020

Trying to migrate from Webstorm, and this sucks.

@keitherskine
Copy link

In SQL Server Management Studio and Textpad, I often like to split a single tab into two views, one on top of the other, so I can see two sections of a file in the same tab. It's very convenient for keeping the important parts of the code right in front of my eyes. And just to be clear, when I click to a different tab, the whole of the previous tab (with both views) hides behind the new tab. I don't want to have two tabs for the same file, where the second tab is still visible even after I click to a different tab. (Hope that makes sense.) Would definitely appreciate this.

@raulsouzalima
Copy link

Any news here?

@Hubro
Copy link

Hubro commented Aug 13, 2020

@bpasero What is the status of this feature request? Has it been added to any roadmaps or backlogs? I think the duplicates and thumbs up indicate a pretty healthy demand.

@bpasero
Copy link
Member

bpasero commented Aug 13, 2020

@Hubro it is on the Backlog:

image

As for indicating "healthy" demand, this issue is currently at position ~250 in terms of upvotes based on this list:

https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc

image

So I would argue, 250 issues have more demand compared to this one (if you count upvotes as a sign for demand). As such, it may stay on the Backlog for a longer period or even forever.

@msftwindowslinux
Copy link
Contributor

Perhaps it would help to have some color on whether this is a limitation of electron, or if there are other architectural challenges to making this happen. For instance, I noticed in the discussion on custom editors / webviews there was mention of

Non-goals
...
Embedding of VS Code's text editor in webviews

Is that a possible solution, or am I completely barking up the wrong tree? Would be nice to get a feel for how this might relate to other items on the UI roadmap (e.g. detachable terminals and editors), or maybe some pointers for community solutions (extensions or PR attempts). Thanks.

@bpasero bpasero modified the milestones: September 2021, Backlog Sep 8, 2021
@bpasero bpasero changed the title Allow to split an editor into two without creating separate tabs Allow to open two editors side by side in one group Sep 8, 2021
@bpasero
Copy link
Member

bpasero commented Sep 8, 2021

Reading through the comments and linked issues, it looks like the original intent of just splitting 1 editor into 2 is not what got all the upvotes. Instead, it seems that some are asking for being able to open 2 different editors in the same group (also in #22068) and others want to open as many editors as they want side by side in a group ("VIM Style Tabs").

I feel that being able to open any 2 editors side by side in a group is realistic. Being able to have a full grid of editors within a group is imho rather unrealistic for the complexity this brings and given we have full grid support via groups already.

As such I have extracted #132651 for the work I am planning to do in September or what is already pushed with regards to being able to split an editor into 2.

@bpasero bpasero removed their assignment Sep 14, 2021
@bpasero bpasero changed the title Allow to open two editors side by side in one group Allow to open two distinct editors side by side in one group Sep 14, 2021
@heartacker
Copy link
Contributor

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
Copy link
Contributor

click setting file will create new-two-tab-view even opened
001splite

@bpasero
Copy link
Member

bpasero commented 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
Copy link

ted1030 commented Sep 25, 2021

I hope this feature can also be used when we move the terminal to the editor area.

@ChugunovRoman
Copy link

ChugunovRoman commented Oct 28, 2021

@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
Copy link
Member

bpasero commented Oct 28, 2021

There is no official API, though arguably an extension could open an editor and then trigger the workbench.action.splitEditorInGroup command right after.

@veryjos
Copy link

veryjos commented Jan 18, 2022

Reading through the comments and linked issues, it looks like the original intent of just splitting 1 editor into 2 is not what got all the upvotes. Instead, it seems that some are asking for being able to open 2 different editors in the same group (also in #22068) and others want to open as many editors as they want side by side in a group ("VIM Style Tabs").

I feel that being able to open any 2 editors side by side in a group is realistic. Being able to have a full grid of editors within a group is imho rather unrealistic for the complexity this brings and given we have full grid support via groups already.

As such I have extracted #132651 for the work I am planning to do in September or what is already pushed with regards to being able to split an editor into 2.

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
Copy link
Contributor

it seems that some are asking for being able to open 2 different editors in the same group

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:
Kapture 2022-02-11 at 17 27 44

@aggrhm
Copy link

aggrhm commented 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
Copy link
Contributor

this is pretty much exactly what my extension "Workviews" (https://marketplace.visualstudio.com/items?itemName=agquick.workviews) does

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
Copy link

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.)

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
Copy link

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.

@bhavyaus bhavyaus closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@bhavyaus bhavyaus reopened this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests