How I can make ctrl + click
to go to definition in visual studio code editor for mac OS? Now it is F12 which is using my mac for show desktop.
First and foremost, please note that in VS Code for macOS, the familiar Ctrl + click from Windows / Linux operating systems has been replaced with ⌘ + click (i.e.: "command + click"). Try that first before proceeding any further as that shortcut should work out of the box without any special modifications.
However, if the above still doesn't work for you then try fixing the problem by editing your settings.json
file. To do that, press F1, type settings json
, then click Open Settings (JSON)
, and then do one of the following:
To use ⌘ + click as your "Go to definition" shortcut, ensure the following line exists in your JSON settings:
"editor.multiCursorModifier": "alt",
What this does is it explicitly sets VS Code's "add another cursor" shortcut to option + click (try it out for yourself!), thus freeing up ⌘ + click to be used for the "Go to definition" operation.
Conversely, to use option + click as your "Go to definition" shortcut instead, add:
"editor.multiCursorModifier": "ctrlCmd",
Note: the above line will actually set the "add another cursor" shortcut to ⌘ + click (not Ctrl + ⌘ + click, as implied by the JSON value).