VSCode zoom only font not whole editor
Ever been screen sharing your code editor (in my case VSCode) and someone asks to bump up the font size? Yes, me too.. All the time. The annoying part of VSCode is they provide keyboard short cuts to zoom. But this applies to the whole of VSCode.
Being able to just increase the editor font size isn't something standard, but as with VSCode pretty much everything is customisable. To create custom key bindings to only increase the editor font size (zoom) you do the following: (Mac instructions)
Instructions for Mac
- Code > Preferences > Keyboard Shortcuts
- This opens a GUI for keyboard shortcuts - click on the tab "Keyboard Shortcuts", and an icon with a file and arrow will appear (title - Open Keyboard Shortcuts JSON)
- Copy paste the below JSON into the file and save
- Done
[ { "key": "cmd+=", "command": "editor.action.fontZoomIn" }, { "key": "cmd+-", "command": "editor.action.fontZoomOut" }, { "key": "cmd+0", "command": "editor.action.fontZoomReset" } ]
Instructions for Windows
- File > Preferneces > Keyboard Shortcuts
- This opens a GUI for keyboard shortcuts - click on the tab "Keyboard Shortcuts", and an icon with a file and arrow will appear (title - Open Keyboard Shortcuts JSON)
- Copy paste the below JSON into the file and save
- Done
[ { "key": "ctrl+=", "command": "editor.action.fontZoomIn" }, { "key": "ctrl+-", "command": "editor.action.fontZoomOut" }, { "key": "ctrl+0", "command": "editor.action.fontZoomReset" } ]
Note: you will need to change the keybaord item, cmd
for Mac and ctrl
for Windows to match the correct key for your
environment.
Note: as pointed out on
twitter by Matteo
the +
and -
key values are the keys "normally" next to the 0 and
backspace, not the keys on a numpad
yeah, thanks if you look in the gif I already changed to ctrl, but one thing i realize now is that you should not use + and - from the numpad,
— Matteo (@MVelludini) January 18, 2021
the + and - not from the numpad works as expected