I'm running VSCode for Golang development on my Macbook. If I right click on a method I can "Go To Definition", but it also says that I can use the keyboard shortcut of F12
to accomplish the same thing. The problem is that there is no F12
key on my macbook. I have an external keyboard that appears to be trying to double use the "Increase volume" button as a F12
key, but even when I try using that it doesn't work.
What is the proper keyboard shortcut for "Go To Definition" (or any shortcut that uses the function keys) when you are using a Mac?
Advanced customization To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.json file where you can overwrite the Default Keyboard Shortcuts.
Hold Ctrl and press Tab to view a list of all files open in an editor group. To open one of these files, use Tab again to pick the file you want to navigate to, then release Ctrl to open it. Alternatively, you can use Ctrl+Alt+- and Ctrl+Shift+- to navigate between files and edit locations.
You can define a keyboard shortcut for any task. From the Command Palette (Ctrl+Shift+P), select Preferences: Open Keyboard Shortcuts File, bind the desired shortcut to the workbench.action.tasks.runTask command, and define the Task as args .
On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard.
A few options:
Hold the fn
key and then press f12
(if your keyboard has an fn
key)
Change the VS Code keybinding
Change your mac to use normal function keys: System Preferences -> Keyboard -> Use F1, F2, etc. as standard function keys
refer to the below Visual Studio Code URL https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition
For Macbook
Press COMMAND (i.e. ⌘) symbol and hover over a symbol for the preview of the definition.
You can also jump to the definition by with COMMAND button (i.e. ⌘) + Click or press COMMAND + OPTION + Click to open the definition to the side.
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