Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set window size and position in Visual Studio Code?

Tags:

Is it possible to set the VS Code window size and position, either via settings.json, though an extension, or by some other mechanism?

In Atom, I can do this in my init.coffee file as such:

atom.commands.add 'atom-workspace',
    'custom:prepare-for-screencast': ->
        atom.setSize(1280, 720)
        atom.setPosition(37, 50)

Then I can call Prepare for screencast from the Command palette.

like image 665
Mark Richman Avatar asked Jun 07 '17 12:06

Mark Richman


People also ask

How do I change the window size in Visual Studio Code?

You can adjust the Zoom level in VS Code with the View > Appearance > Zoom commands. The zoom level increases or decreases by 20% each time a Zoom command is executed. View > Appearance > Zoom In (Ctrl+=) - increase the Zoom level. View > Appearance > Zoom Out (Ctrl+-) - decrease the Zoom level.

How do I change the position of my Explorer in VS Code?

VSCode tip: You can move the sidebar/file explorer to the right-hand side of your editor via View > Appearance > Move Side Bar Right.

How do you Auto Arrange in VS Code?

The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.


2 Answers

Not...yet?

https://code.visualstudio.com/docs/getstarted/settings

The closest I can find is window.newWindowDimensions, which only takes a few strings that refer to predefined geometries, although 'inherit' could serve you well in the meantime if you prime the pump by closing al your existing sessions, opening one window, sizing it to your liking, then quitting. Then all your new windows should be that size, and Visual Studio Code seems to be very well behaved with respect to resizing, just never close a resized window last, or it becomes your new default!

As for position, there appears to be nothing at all.

like image 95
M. Ayers Avatar answered Sep 24 '22 17:09

M. Ayers


in vscode, go to

settins=>windw=>new window => new window dimension

there you are able to choose the following option to set the default dimensions, if vscode is getting opened:

inherit || offset || maximized || fullscreen

I prefer to use "inherit", i.e. open vs-code always as large as the previous one.

like image 40
vikbert Avatar answered Sep 25 '22 17:09

vikbert