Ben
Ben

Reputation: 10288

In Visual Studio Code: How can I find the key of any command?

There's a command in Project Manager extension that opens the project in a new window. VScode Action

I'd like to add a key binding to this action but I couldn't find the key to add a binding to. Is there a generic way to find the key of the last command run? That would be the "Teach a man to fish" solution for me.
If you just know the key, that would be the fish :) But it's better than going hungry.

Thanks In Advance!

Upvotes: 1

Views: 360

Answers (1)

Wosi
Wosi

Reputation: 45213

  • Go to File -> Preferences -> Keyboard Shortcuts
  • Click Define Keybinding to create a new entry
  • Go to the command entry and start typing the name of the extension. In this case ProjectManager. Code completion will show up and suggest all commands which belong to this extension* enter image description here
  • Select the one you want to bind and save the file to activate the new shortcut

Note: You can find a list of all available commands also at the bottom of the left tab named "Default Keyboard Shortcuts"

Alternative way: Get a list of all commands for an extension

  • Click on the extensions icon in the sidebar
  • Select the extension
  • Click on the Contributions tab
  • A list of all contribution points including Commands are shown enter image description here

Upvotes: 2

Related Questions