Reputation: 357
While changing VS Code's "windows zoom" setting, I accidentally changed the zoom setting to 10, so now it is zoomed so much that I can't change it to default.
Upvotes: 14
Views: 15049
Reputation: 52499
The Window zoom settings affect all GUI elements in VSCode, including the editor, the sidebar, the status bar, the command palette, the settings, etc. This setting shows up in the settings.json file as "window.zoomLevel": 0,
, for example. It affects all open VSCode Windows. If you'd just like to zoom in and out in this window's editor only, see the section below on "Editor font size zoom" instead.
You can zoom in and out with Ctrl + + (technically Ctrl + =), and Ctrl + -, respectively.
But, that doesn't tell you where your default zoom level is exactly. To reset back to the default zoom level in a single go, there are three ways:
settings.json
file by pressing Ctrl + Shift + P and then searching for "Preferences: Open User Settings (JSON)". Find your "window.zoomLevel"
and set it to "window.zoomLevel": 0,
.Your zoom will be back to default.
If you're editing your user settings.json
file directly (located at ~/.config/Code/User/settings.json
on Linux, by the way), here are a few more possible values for it, to help you gain understanding:
// zoomed out 8 levels (this is the minimum zoom)
"window.zoomLevel": -8,
// zoomed out one level
"window.zoomLevel": -1,
// default zoom level
"window.zoomLevel": 0,
// zoomed in one level
"window.zoomLevel": 1,
// zoomed in 8 levels (this is the maximum zoom)
"window.zoomLevel": 8,
As you manually zoom in and out with Ctrl + + and Ctrl + -, you can see this setting change. When you get to the default zoom level of 0
, it will remove the setting entirely, since that's the default zoom level.
You can open the default settings file to see all default settings by pressing Ctrl + Shift + P and then searching for "Preferences: Open Default Settings (JSON)".
In there you'll see this for the window zoom level. Notice that the explanation says you can also use zoom decimals for finer granularity (ex: "window.zoomLevel": 0.5
):
// Adjust the zoom level of the window. The original size is 0 and each
// increment above (e.g. 1) or below (e.g. -1) represents zooming 20% larger or
// smaller. You can also enter decimals to adjust the zoom level with a finer
// granularity.
"window.zoomLevel": 0,
If you have multiple windows of VSCode open, you can adjust the font size zoom only for this one window by using the Editor Font Zoom
commands instead. Press Ctrl + Shift + P to enter the command menu, then search for Editor Font Zoom
, and select one of the three options below:
Editor Font Zoom In
Editor Font Zoom Out
Editor Font Zoom Reset
...as shown here:
These do not create a new setting entry inside settings.json
. Instead, they just change the font size of the editor in the current window, allowing you to have different font sizes in different windows.
This is very useful when you have multiple monitors with different resolutions, and you want to have a different font size on each monitor. You may need to set the Window zoom which affects all windows to meet your needs on the main monitor, but then adjust the font zoom only on the secondary monitor to make it look right. I have a 4k 32" main monitor with a huge resolution of 3840 x 2160, making everything on it tiny, and a really old monitor with a tiny resolution of 1280 x 1024, making everything on it look huge. Now, I can use Editor Font Zoom Out
repeatedly on the old monitor to make it zoom out enough that it's usable and still provides a really good size editor window.
You can also set keyboard shortcuts for these commands in your keybindings.json
file. We will add these shortcuts:
Editor Font Zoom In
Editor Font Zoom Out
Editor Font Zoom Reset
Press Ctrl + Shift + P to enter the command menu, then search for Preferences: Open Keyboard Shortcuts (JSON)
to open your keybindings.json
file. Then, add these entries:
[
// ... other keybindings here, then add:
{
"key": "ctrl+shift+=",
"command": "editor.action.fontZoomIn"
},
{
"key": "ctrl+shift+-",
"command": "editor.action.fontZoomOut"
},
{
"key": "ctrl+shift+0",
"command": "editor.action.fontZoomReset"
}
]
Save the file and close it, and now you can use the 3 new shortcuts above.
That's everything I know about VSCode zoom.
Upvotes: 18
Reputation: 2145
There are two types of zooms in VS Code:
Upvotes: 9
Reputation:
Go to this path C:\Users\<your admin name>\AppData\Roaming\Code\User
then open the settings file with any text editor at the end of the file change the window.zoomLevel to 0
after changing :
"window.zoomLevel": 0
Upvotes: 0
Reputation: 61
click the reset zoom setting under View>Appearance>Reset Zoom.Otherwise you can use the hotkey which is (CTRL + -).
Upvotes: 6
Reputation: 106
Use (Ctrl+-) to zoom out. Its simple you can google it as well
https://code.visualstudio.com/docs/editor/accessibility
Upvotes: -1