Vscode: Map CTRL + 0 to View: Reset Zoom

Created on 21 Nov 2016  ยท  26Comments  ยท  Source: microsoft/vscode

Right now, the View: Reset Zoom editor command does not have a default keyboard shortcut mapping. To keep consistent with other software, especially Internet browsers such as Internet Explorer, Microsoft Edge, Google Chrome, etc. I'd suggest mapping CTRL + 0 to View: Reset Zoom as a default keyboard shortcut.

Cheers,
Trevor Sullivan
Docker Captain
Microsoft MVP: Cloud & Data Center Management
https://trevorsullivan.net
https://twitter.com/pcgeek86

*as-designed feature-request keybindings

Most helpful comment

Reset zoom have default shortcut of โŒ˜+Numpad0 is really bad on the Mac. The vast majority of Mac users are surely using Macbook Pro, not Mac/iMac, so we don't have any numpad.

Just make any default shortcut that is able to be pressed on MBP. Since the conventional โŒ˜0 is already mapped to workbench.action.focusSideBar, may I suggest โ‡งโŒ˜0? It's currently unused in the default keymap ๐Ÿ‘

All 26 comments

Similar to issue #14979 ? But I still had no response from @alexandrudima !!

@tekbr thanks for pointing out that issue report. It does appear similar.

fyi @bpasero

This keybinding is currently used to focus the sidebar so that you have a nice logical keybinding model of Ctrl+0 being sidebar and Ctrl+1/2/3 to focus an editor group.

@bpasero I recently figured this out. It is convenient to have CTRL + 0 map to the sidebar.

Do you have an alternative suggestion for how this request could implemented, consistent with other programs?

Maybe this should go into a keymap extension to make it "consistent" with whatever the extension is about (Sublime, Atom).

@bpasero Ctrl + Shift + E does the same thing as Ctrl + 0, does not it? I tried on Windws 10, 1.8.0 - insider.

If so, please change Ctrl + 0 to Reset Zoom. This does not require an extension for this.

@Tekbr no it does not:

image

@bpasero If not, what does Ctrl + Shift + E do? I'm confused now. :confused:

gif4

@Tekbr if opens/focus the explorer view. there are keybindings for each view. Ctrl+0 just moves focus to whatever view is active.

@bpasero I do not know if that is what it says: ๐Ÿ˜•
The cursor is in the editor, if you press Ctrl + Shift + Eonce, move to the view explorer, if you press it again "back" the course to the editor.
Using Ctrl + 0does not do it right?

Would that be the difference, or not? If possible show a gif with the difference by pressing the keys.

@Tekbr the difference is that Ctrl+Shift+E (E for EXPLORER) opens the explorer and Ctrl+0 focusses the view that is currently active. Sorry, I am not sure how to explain that any better, maybe someone else can.

@bpasero Ok no problems. So I said to show a gif or something. Sorry for English. :blush: Thank you for the patience.

view-picker

The gif shows how cmd+shift+e and cmd+0 behave differently ๐Ÿ‘

@bpasero Now I see the difference. :smile:
Thank you. And once again I'm sorry. :blush:

In the latest version of VSCode, version 1.8.1, the following changes were added:

  • On Mac OS X, the CMD + NUMPAD 0 keyboard shortcut is bound to View: Reset Zoom
  • On Windows, the CTRL + NUMPAD 0 keyboard shortcut is bound to View: Reset Zoom

Neither of these are usable though, because:

  • The Macbook Pro does not have a numeric keypad
  • Most Windows laptops don't offer numeric keypads (including my Dell XPS 9350)

There has got to be a better solution to this, yeah?

Quick fix for those mildly irritated like me add this to preference/keymaps :)

     {
        "key": "cmd+0",
        "command": "workbench.action.zoomReset",
        "when": "editorTextFocus"        
     }

:+1: @Yahkob Our keybinding system is written in such a way that you can change absolutely everything and this use-case is one of the most simple:

  • Open Preferences > Keyboard Shortcuts
  • Type "zoom"
  • Click the edit icon
  • Record new keybinding
  • Done! ;)

15840

Came here to report this but basically want to write this

https://github.com/Microsoft/vscode/issues/15840#issuecomment-268887968

In the latest version of VSCode, version 1.8.1, the following changes were added:

On Mac OS X, the CMD + NUMPAD 0 keyboard shortcut is bound to View: Reset Zoom
On Windows, the CTRL + NUMPAD 0 keyboard shortcut is bound to View: Reset Zoom
Neither of these are usable though, because:

The Macbook Pro does not have a numeric keypad
Most Windows laptops don't offer numeric keypads (including my Dell XPS 9350)
There has got to be a better solution to this, yeah?

This is an utterly stupid default binding :')

Hi @NinoFloris,

Since Apple[e] desktop machines ship with a numeric keypad and laptops don't, and assuming all OS X users are using Apple hardware, we would need to know what percentage of OS X users run a desktop vs laptop for this default binding to be confirmed as a poor decision

Do you know what the percentage split is?

Disclaimer: I run a Macbook Pro and I do find this default binding strange but I understand there are other (OS X) users with numeric keypads

Regards

[e] https://www.apple.com/mac/

Reset zoom have default shortcut of โŒ˜+Numpad0 is really bad on the Mac. The vast majority of Mac users are surely using Macbook Pro, not Mac/iMac, so we don't have any numpad.

Just make any default shortcut that is able to be pressed on MBP. Since the conventional โŒ˜0 is already mapped to workbench.action.focusSideBar, may I suggest โ‡งโŒ˜0? It's currently unused in the default keymap ๐Ÿ‘

Hi there.
Any news on this?

Unfortunately all the keyboard shortcuts with KeyCode.KEY_0 seem to be occupied. Please see https://github.com/microsoft/vscode/issues/15840#issuecomment-305406363 for a solution by changing this keybinding as needed.

@bpasero But how is this an acceptable default for the Mac though? See my comment above.

@GandalfSaxe if you can come up with a good keybinding, fire up a PR and I can have a look.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  ยท  3Comments

curtw picture curtw  ยท  3Comments

borekb picture borekb  ยท  3Comments

philipgiuliani picture philipgiuliani  ยท  3Comments

trstringer picture trstringer  ยท  3Comments