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.
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:
I found the discussion about enhancing the editor group functionality here
https://github.com/Microsoft/vscode/issues/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.
+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_
+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.
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.
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: https://github.com/Microsoft/vscode/issues/7418
https://github.com/Microsoft/vscode/issues/49062
https://github.com/Microsoft/vscode/issues/41486
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
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
+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!
Trying to migrate from Webstorm, and this sucks.
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.
Any news here?
@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.
@Hubro it is on the Backlog:
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
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.
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.
This is a huge blocker for me to comfortably move from vim to vscode.
I find it very cumbersome to write C++ without this feature. Having a separate vim tab for each pair of .h/.cpp files I'm working on (split vertically) is incredibly useful, as opposed to having a single split and manually swapping out the files in each view every time I want to look at a different class. Even in languages which don't have separate interface/implementation files, having related files (such as code and test) stay open together is very useful. Personally I've found working with splits in VS Code so unmanageable that I just tend to not use them at all.
Most helpful comment
+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.