My VS Code recently started to invert the system shortcuts from command to option.
As you can see here, the option to open a link is now option+click when it was cmd+click.
And the keybindings for open link is set as system
This made me think that the mac shortcuts (the system) should have changed.. but all the mac shortcuts are still using command, as shown in this setting:
I'm very confused, as I don't know what caused this and how to revert it back. I tried working with this, but it's really annoying!
How can I revert this?
What modifier is used for opening links is defined to not conflict with whatever modifier you have chosen for working with multiple cursors. When you have set editor.multiCursorModifier
to "alt"
, you get cmd + click for clicking links, and if you set editor.multiCursorModifier
to "ctrlCmd"
, then you get option + click.
The docs for the multi-cursor modifier support this:
The Go to Definition and Open Link gestures will also respect this setting and adapt such that they do not conflict.
The description text for the editor.multiCursorModifier
setting also says something to that effect.
The default value of editor.multiCursorModifier
is "alt"
, so I'm guessing you changed it to "ctrlCmd"
.
You can cross-check with the source code too: The relevant code is in src/vs/editor/contrib/links/browser/links.ts. The string constants you see ("Follow link" and "option + click") are in the getHoverMessage
function, where you can see that the choice of whether option or cmd depends on a parameter named useMetaKey
. The only caller of getHoverMessage
is _getOptions
- a private static function property of the LinkOccurrence
class. _getOptions
is used in its public, static decoration
function property, and activate
and deactivate
instance function properties, which all just pass along useMetaKey
parameters of their own. If you look for usages of the LinkOccurrence
class, you'll see those functions used in the following places: updateDecorations
, _onEditorMouseMove
, and cleanUpActiveLinkDecoration
, in each of which where useMetaKey = (this.editor.getOption(EditorOption.multiCursorModifier) === 'altKey');
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With