简体   繁体   中英

How to use VSCode keyboard shortcuts with a Mac?

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?

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 (ie ⌘) symbol and hover over a symbol for the preview of the definition.

You can also jump to the definition by with COMMAND button (ie ⌘) + Click or press COMMAND + OPTION + Click to open the definition to the side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM