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).
Answer from cactuschibre on Stack OverflowFirst 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).
Settings > User > multiCursorModifier must be set to alt (default), so the ctrl/cmd will be available to go to definition.
Documentation:
The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier.
Cmd+Click on Mac OS Ventura not working on definitions
Ctrl click not working
VS Code Go to definition (command + click) not working unity
Ctrl Click (Cmd Click on mac) on require does not follow JSON
I have a mac and I could not get ctrl + click to take me to the function definition, even after trying all the recommendation I could find online and asking chat. For some reason it was mapped to option + click instead. Hope this helps others, there seemed to be nothing online about this :)
Does anyone know how to fix this? It's not a must, but it bothers me.
While many people might have another keyboard hooked up to their computer, that wasn't the case for me. You can be sure by disabling bluetooth (if your main keyboard is wired).
Other problems I've researched include: specific websites mess with CMD+Click via javascript either intentionally or accidentally. To debug, try a few different websites. If it's just one website that you really want CMD+Click to work on, there are some chrome extensions you can try, I haven't used any of them.
Make sure your CMD key works correctly. The OP in this thread did this via using CMD+0 or CMD+1 to navigate to different tabs.
Not sure what my issue was, but restarting the OS fixed it. Give that a try. Good luck.
As @apennebaker commented. The issue ended up being a bluetooth keyboard in a backpack.
Ah, "the old" backpack and keyboard problem.
Obviously not everything is better with bluetooth.