Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: how to undo split screen and show just current file?

VSCode provides sweet shortcuts for manipulating (splitting and rearranging) screens:

  1. Press Ctrl + \ to split your screen in two.
  2. Press Ctrl + Number to focus on one of the screeens
  3. Press Ctrl + Shift + 0 to change vertical/horizontal split

However, how do I remove all the split screens and just show the currently focused one?

Example: say, I press Ctrl + \ two times (gives me three vertical screens), then press Ctrl + 2 to select middle screen. What should I press now to make left and right screen disappear and middle screen occupy the whole space? In Emacs, that would be Ctrl + X + 1.

like image 479
alisianoi Avatar asked Jun 01 '19 19:06

alisianoi


People also ask

How do I undo split editor?

Removing Split To remove split after splitting the screen into two, double-click on the vertical or horizontal split boundary. The split is then removed. Alternatively, dragging the boundary to the left/right or top/bottom of the screen also removes the split.

How do I close a split window in Visual Studio?

Look near the top. The -> Split. That should unsplit the view.


4 Answers

See if this keybinding does what you want:

{
  "key": "alt+q",
  "command": "workbench.action.closeEditorsInOtherGroups"
}

There is no default keybinding for the command workbench.action.closeEditorsInOtherGroups so I made up that one. I think it accomplishes what you want. It will close the other editor groups and keep you at the focused group.

like image 158
Mark Avatar answered Nov 08 '22 16:11

Mark


I solved this by clicking on View > Editor Layout > Single

enter image description here

Hope it also works for you =)

like image 23
Angely Oyola Suárez Avatar answered Nov 08 '22 16:11

Angely Oyola Suárez


Invoke Command palette (pressing Ctrl + Shift + P by default) and type/search for:

View: Close Editors in Other Groups

like image 21
daGo Avatar answered Nov 08 '22 16:11

daGo


View Menu -> Editor Layout -> Single

like image 44
Mna Avatar answered Nov 08 '22 18:11

Mna