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 for empty editor panes #2755

Closed
sarbbottam opened this issue Feb 6, 2016 · 53 comments
Closed

Allow for empty editor panes #2755

sarbbottam opened this issue Feb 6, 2016 · 53 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan workbench-editor-grid Grid layout issues in the editor area
Milestone

Comments

@sarbbottam
Copy link

Is there a way to configure VSCode, so that it always shows a fixed number of pane? Or keep the pane even when there is no open file.

Something like
screen shot 2016-02-05 at 6 31 53 pm

@bpasero
Copy link
Member

bpasero commented Feb 6, 2016

Currently not.

@bpasero bpasero added feature-request Request for new features or functionality workbench labels Feb 6, 2016
@bpasero bpasero added this to the Backlog milestone Feb 6, 2016
@bpasero bpasero self-assigned this Mar 30, 2016
@bpasero bpasero added the workbench-tabs VS Code editor tab issues label May 30, 2016
@bpasero bpasero removed the workbench-tabs VS Code editor tab issues label Jun 15, 2016
@bpasero bpasero removed their assignment Aug 17, 2016
@ykka
Copy link

ykka commented Sep 15, 2016

Oh I beg you, let's allow it!

Use cases:

  • sometimes you just want to click into an empty pane and open some file there. Duplicating your currently open file just to open another one in a new pane (correct me if I am missing some shortcut), is a bit pointless. Worse, it leaves you with many editor instances of the same file.
  • sometimes you just want to keep it split into three columns visually - for some it's a matter of harmony, symmetry. For me the dynamic behaviour of all the editor panes feels a bit messy for example. Their width changes all the time.
  • sometimes I just want to keep some information and discard it once I am done. It'd cool if I could have empty pane, hit cmd+n and paste stuff there.

Yes, I come from Sublime but that IMO has been one of the features that created the feeling of simplicity. The way you split your editor - it stays this way.

@jasonlemay
Copy link

I've recently switched from Sublime to VSCode, and it's the only missing feature that is bothering me on a daily basis.

@bpasero bpasero changed the title Keep the pane open even when there is no file. Allow for empty editor panes Feb 19, 2017
@ttbarnes
Copy link

+1. Also currently when you open a new pane, it duplicates the file in the original pane. To work on a new file in a new pane, you have to close the duplicate file opened in the new pane, before opening a new file in the new pane.

@cranesandcaff
Copy link

Is this something that could be added with an extension?

@darraes
Copy link

darraes commented May 19, 2017

This is really bothering me as well.

@aubreypwd
Copy link

+1

1 similar comment
@albert-olive
Copy link

+1

@emyller
Copy link

emyller commented Jun 16, 2017

That and #16858 (comment) would be awesome.

@aaronbushnell
Copy link

aaronbushnell commented Jun 17, 2017

It'd be nice to have this functionality natively, but here's a temporary, hack-y and untested solution for the short term!

  1. Install the Macros extension to allow you to map keyboard shortcuts to a sequence of commands.
  2. Add the following JSON to your settings.json file:
"macros": {
  "splitPane": [
    "workbench.action.splitEditor",
    "workbench.action.files.newUntitledFile",
    "workbench.action.moveEditorLeftInGroup",
    "workbench.action.closeEditorsToTheRight"
  ]
}
  1. Add the following JSON to your keybindings.json file:
[
  {
    "key": "cmd+alt+2",
    "command": "macros.splitPane",
    "when": "editorTextFocus"
  }
]

Now when you use the cmd+alt+2 shortcut, VS Code will split the editor, create a new file, move this file to the first position in the group and close the other file in the split.

There might be a more efficient way to do this, but this was a quick test to see if it would work at all.

screen recording 2017-06-17 at 02 32 pm

@ivanbanov
Copy link

@aaronbushnell It works, thanks

@mehulkar
Copy link

mehulkar commented Sep 6, 2017

Also a Sublime -> VSCode convert and trying to get used to it. A typical workflow for me is to:

  1. open VSCode
  2. Open File1
  3. Split pane
  4. Open File2

Right now, the only way I know of to do this is to:

  1. Open VSCode
  2. Open File1
  3. ⌘+/ to open File1 again in the second split
  4. ⌘+P to find and open File2
  5. ⌘+Shift+Tab to go back to the second File1
  6. Close File1

The most surprising thing about this is that ⌘+/ opens the same file again in the second split. I'm not sure why I would ever want the same file open twice?

@SavePointSam
Copy link

Waiting on this to be fixed before I can switch to Code over Atom.

@johndugan
Copy link

As a dev floating between Sublime and Code, this is the biggest downfall of Code at the moment.

In addition to the new pane's initial state being empty when triggered, multiple keyboard shortcuts should be allowed (alt+shift+1 = 1 pane, alt+shift+2 = 2 panes, etc.), and when keyboard shortcuts are triggered they should reset (evenly distribute) the horizontal space.

@rkpatel33
Copy link

+1

2 similar comments
@simonvomeyser
Copy link

+1

@pratuat
Copy link

pratuat commented Nov 14, 2017

+1

@johndugan
Copy link

Curious if @bpasero could give us an update on this issue?

@bpasero bpasero added the workbench-editors Managing of editor widgets in workbench window label Nov 16, 2017
@willsoto
Copy link

@bpasero I'd be interested in taking a stab at this, if you think it's feasible. I just need to be pointed in the right direction.

@bpasero
Copy link
Member

bpasero commented Mar 29, 2018

@willsoto thanks for your help but in this case I would stay away from a PR because this area will get a rewrite for the planned grid layout feature. I was planning to tackle this as part of the grid layout.

@alexburner
Copy link

@bpasero grid layout sounds exciting! Any public plans/details you could link us to?

@daniel-hubdoc
Copy link

+1

@AndreasBackx
Copy link
Contributor

@bpasero is there an ETA for the grid layout feature?

@bpasero bpasero added workbench-editor-grid Grid layout issues in the editor area and removed layout General VS Code workbench layout issues labels May 10, 2018
@bpasero
Copy link
Member

bpasero commented May 31, 2018

@AndreasBackx yes, June. See #49599 (comment)

@ttbarnes
Copy link

@bpasero Thank you, looks great! I'm interested what the keybindings will be like?

@bpasero
Copy link
Member

bpasero commented May 31, 2018

@ttbarnes for what action specifically?

@ttbarnes
Copy link

@bpasero EG splitting into 2/3 horizontal columns?

@bpasero
Copy link
Member

bpasero commented May 31, 2018

@ttbarnes still the same keybinding as before. we support splitting of editors independent from this issue.

@AndreasBackx
Copy link
Contributor

AndreasBackx commented May 31, 2018

@bpasero thank you very much for the update. What is the new behaviour when splitting a view? Currently when you split the view, it opens the current file twice which more often than not you never really need. If this remains the same, is there a possibility into making this configurable?

@bpasero
Copy link
Member

bpasero commented May 31, 2018

@AndreasBackx with the new grid work it will show an empty editor group instead of opening an editor.

@AndreasBackx
Copy link
Contributor

@bpasero sweet, I'll check it out on the Insiders build once it's available and when I can find the time between my finals. Thank you once again for the PR!

@bpasero bpasero self-assigned this Jun 1, 2018
@bpasero bpasero added this to the June 2018 milestone Jun 1, 2018
@bpasero
Copy link
Member

bpasero commented Jun 2, 2018

This landed as part of #14909. A setting workbench.editor.closeEmptyGroups allows to configure if closing the last editor of a group should also close the group.

image

While this feature will land into our insider builds only sometime next week (for a stable release end of June), we have custom insider builds for testing this feature now available for more people to try out:

Note: In order to run these builds you will first have to close any running VSCode Insiders build.

Feedback is very welcome, ideally as individual issues and not as comments here to reduce the number of notifications for people subscribed. Please ensure to first have looked for any existing issue with the workbench-grid label already: query

@bpasero bpasero closed this as completed Jun 2, 2018
@alexburner
Copy link

Sorry this is basically a +1 comment but YESSSSS SO EXCITED! Thanks @bpasero !

@that70schris
Copy link

that70schris commented Jul 5, 2018

this is so close to being so perfect, only thing left for me is to disallow closing of an already empty group using the close keyboard shortcut (command+W). If I want to close a group I want the only option to do so to be clicking the x in the upper right hand corner, or possibly a different shortcut.

@bpasero
Copy link
Member

bpasero commented Jul 6, 2018

@that70schris easy, just add this to keybindings:

{
	"key": "cmd+w",
	"command": "-workbench.action.closeGroup",
	"when": "activeEditorGroupEmpty && multipleEditorGroups"
}

@karlhorky
Copy link

karlhorky commented Jul 6, 2018

Thanks @bpasero! Maybe that should be documented more prominently in the grid editor layout docs themselves? Seems like something that more people would want to set... Or maybe it's even relevant enough to be default when workbench.editor.closeEmptyGroups is set to false?

karlhorky added a commit to karlhorky/dotfiles that referenced this issue Jul 6, 2018
@that70schris
Copy link

awesome! @bpasero thanks!

@a13o
Copy link

a13o commented Jul 8, 2018

I close my tabs using middle click, and unfortunately it doesn't respect the workbench.editor.closeEmptyGroups. There's no way to rebind mouse buttons either, so no workaround via keybindings.

I think @that70schris is correct and setting the workbench.editor.closeEmptyGroups flag to false should be enforced consistently across all ways to close a tab.

Great feature, otherwise! This was the one thing missing from vscode for me

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan workbench-editor-grid Grid layout issues in the editor area
Projects
None yet
Development

No branches or pull requests