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.
Go to Definition# If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.
go to File -> Preferences -> Keyboard shortcuts, or press Ctrl+K, then Ctrl+S, or edit %UserProfile%\AppData\Roaming\Code\User\keybindings.
Visual Studio Go To Definition The Go To Definition feature navigates to the source of a type or member and opens the result in a new tab. Using Keyboard, place your cursor on the member name and press F12. Using the mouse, right-click on the member name and select Go To Definition from the menu.
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).
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