Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maximize a split in VScode

I like the split view mode in VS Code but one thing I can't figure out is how to maximize a split view temporarily.

I would like to be able to maximize a split window (as in on one of the windows of a split) for a moment and then restore the layout when I am done with it.

like image 811
yarun can Avatar asked Dec 25 '18 21:12

yarun can


People also ask

How do you expand a selection in VS Code?

Shrink/expand selection# Quickly shrink or expand the current selection. Trigger it with Shift+Alt+Left and Shift+Alt+Right.

How do I change the split screen in VS Code?

In VSCode (v1. 64) F6 is already assigned to the command that switches between "parts", which is also useful, so I did Shift+W instead.

How do I maximize a window in Visual Studio?

To get the maximum bit of screen real estate available, you can put your Visual Studio edit window in full-screen mode by selecting View | Full screen (or just pressing Shift+Alt+Enter).


Video Answer


1 Answers

v1.38 has a new command:

workbench.action.toggleEditorWidths

which can be useful here. It is unbound to a keybinding by default.

Say you bind it like so:

{
    "key": "ctrl+alt+b",
    "command": "workbench.action.toggleEditorWidths"
}

Then use it once to maximize one of the splits - after that switching focus to either one will maximize that one easily. Basically, using the workbench.action.toggleEditorWidths command once will do the work of manually dragging the separator bar for you.


Before v1.38

From the July 2018 Release Notes: Automated maximize of minimized editors.

To get this to work you have to first manually minimize one of the splits (or editors in an editor group).

Drag the separator bar between the editors as far left (or right) as it will go.

Or use the command View: Maximize Editor Group.

Then clicking in or otherwise focussing (perhaps with workbench.action.focusLeftGroup or similar) the other split will maximize it.

Note: You can always maximize the active editor via View: Maximize Editor Group (workbench.action.minimizeOtherEditors) or reset all editor sizes via View: Reset Editor Group Sizes (workbench.action.evenEditorWidths).

like image 127
Mark Avatar answered Oct 07 '22 13:10

Mark