Skip to content

Add option to automatically move files to current tab group on open #204942

@jonathanjameswatson

Description

@jonathanjameswatson

From @aguynamedben in #41289:

I wish to live in a "don't-care-about-tabs" world but still want a way to split my editor's UI. However, the idea of tabs and tab groups seems deeply embedded into VS Code's ability to split windows, so I'm skeptical this is coming any time soon.

The best way out of this I can think of is some kind of settings such as:

"workbench.editor.moveToCurrentTabGroupIfOpen": true,

This would be similar to workbench.editor.revealIfOpen but opening a file that's already open in another tab group would move that file into the current tab group. Then I could disable all tab-centric UIs in VS Code and indiscriminately open any file within any split and not end up with a mess of duplicate files open across many tab groups. I think this might be sufficient for most tab-haters.

Working without Tabs could say:

If you're used to text-focused editors such as Emacs or vi and simply want to view any open file within any split without regard for tab or tab groups, set:

"workbench.editor.showTabs": true,
"workbench.editor.revealIfOpen": true,
"workbench.editor.moveToCurrentTabGroupIfOpen": true

With this setup, the underlying tabs and tab groups system will continue power which files are shown in which visual split, but that will be mostly irrelevant in day-to-day use. You wont see tabs, and opening a file will "move" the open file into whatever tab group ("visual split") you're focused on, similar to Emacs buffers and "windows".

#41289 was originally closed as it was out of scope. However, this suggested feature does not seem out of scope and seems easier to implement than just removing editor groups altogether. I would be happy to try to implement this.

Activity

jonathanjameswatson

jonathanjameswatson commented on Feb 11, 2024

@jonathanjameswatson
Author

It seems like this might have already been somewhat implemented by @mkcode in #134525 over 2 years ago. Is there any reason why this hasn't been merged and is there anything I can do to help get it merged?

mkcode

mkcode commented on Feb 11, 2024

@mkcode

I'll chime in again just to share my experience and perspective with all this:

I completely understand microsoft's values in making vscode as accessible as possible. And, vscode is so close to be able to make people that prefer keyboard oriented approaches (usually coming from vim or eMacs) happy as well. It's just one or two "opt-in" settings away, meaning there would be no changes to the out of the box user experience.

Ultimately, I was unable to create a consistent keyboard oriented workflow in vscode, and have therefore been using neovim. A lost user that could have been supported, by allowing an opt-in setting change to unlock keyboard oriented workflows.

aguynamedben

aguynamedben commented on Feb 17, 2024

@aguynamedben

+1

@jonathanjameswatson interesting that it doesn't seem that difficult to implement. #134525 is pretty close, I'd just want it to move the tab into current tab group from quick open (not open again).

Hmmm, I've never hacked on VS Code, but given that the other PR is 20 lines and I think there could be a compelling 2 minute video "how to setup VS Code like Neovim or Emacs" it could be pretty compelling and I don't see why it wouldn't be merged.

jonathanjameswatson

jonathanjameswatson commented on Feb 17, 2024

@jonathanjameswatson
Author

I think it makes sense to move the editor to the current tab group rather than re-open it – with re-opening, if you only use quick open, then you could presumably end up with all editors being in all tab groups.

I believe complexity may come from the interaction between revealIfOpen and moveToCurrentTabGroupIfOpen. It would not be an unreasonable to assume that moveToCurrentTabGroupIfOpen would not require revealIfOpen to be set, but if this was the case then it would not be clear what would happen if both were set. Perhaps we could use a name like moveToCurrentTabGroupOnOpenReveal instead? Although, perhaps that is too verbose.

jonathanjameswatson

jonathanjameswatson commented on Feb 17, 2024

@jonathanjameswatson
Author

I have made a PR that implements this feature: #205442

Demo here:

2024-02-17.15-56-14.mp4
aguynamedben

aguynamedben commented on Feb 17, 2024

@aguynamedben

@jonathanjameswatson Amazing!!! It works just like I imagined.

This will really help users coming from Emacs or vi. Users of those editors are accustomed to splitting windows into "frames" or "panes", then being able to recall any buffer into any frame without the file being opened a 2nd time. Your PR and revealIfOpenInActiveGroup makes that possible in VS Code. Without this, users must open a file once-per-Editor Group which creates a mess and kills the "fast switching". This is especially confusing for users who want to do side-by-side editing with tabs turned off.

I wrote these docs that I think should go under the "Working without Tabs" section, but I don't see how to edit the docs in the vscode repo.

Docs: #205442 (review)

aguynamedben

aguynamedben commented on Feb 17, 2024

@aguynamedben

@mkcode Can you review the PR and docs in my approval as well? Thank you!

3 remaining items

aguynamedben

aguynamedben commented on Feb 18, 2024

@aguynamedben
sutram

sutram commented on Feb 19, 2024

@sutram

This would be great!

vscodenpa

vscodenpa commented on Feb 20, 2024

@vscodenpa

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

aguynamedben

aguynamedben commented on Mar 5, 2024

@aguynamedben

@bpasero @benibenj This feature has been implemented (PR) and documented (PR).

Who can me and @jonathanjameswatson work with to get the PR merged? This is my first time contributing to VS Code and it's been a good experience so far!

aguynamedben

aguynamedben commented on Sep 9, 2024

@aguynamedben

@benibenj Is there any way to bump this?

The feature is implemented, works great, is documented, is under an option, and has the votes required.

It seems like it's just stuck in VS Codes "backlog" process. This feature will help users switch from vim/neovim/Emacs and other buffer-based editors to VS Code.

benibenj

benibenj commented on Sep 10, 2024

@benibenj
Contributor

Pinging @loganrosen as the change is part of the Editor Resolver Service

loganrosen

loganrosen commented on Sep 10, 2024

@loganrosen
Member

I think you meant @lramos15 🙂

benibenj

benibenj commented on Sep 11, 2024

@benibenj
Contributor

Exactly, I meant @lramos15, sorry 😅

aguynamedben

aguynamedben commented on Nov 12, 2024

@aguynamedben

Bump!

ihdavids

ihdavids commented on Nov 23, 2024

@ihdavids

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionalityworkbench-editor-resolverIssues resolving the editor inputsworkbench-editorsManaging of editor widgets in workbench window

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @aguynamedben@mkcode@loganrosen@bpasero@ihdavids

      Issue actions

        Add option to automatically move files to current tab group on open · Issue #204942 · microsoft/vscode