ChiliYago
ChiliYago

Reputation: 12289

VSCode Keyboard command ids

When creating or editing the keybindings.json file v1.2.1 of Visual Studio Code requires not only the key to bind but also the 'CommandID' and 'When' condition.

I am looking for a complete list of 'CommandIDs' available to use and have been unable to find one. Where is that complete list of commands ?

Thanks

Upvotes: 12

Views: 4432

Answers (4)

KyleMit
KyleMit

Reputation: 29899

This isn't trivial, but does answer the question.

You can retrieve all commands from within a VS Code Extension. So if you create your own like this:

npm install -g yo generator-code
yo code

Then you can use the commands object like this:

let commands = await vscode.commands.getCommands()

Which does the following according to the docs:

Retrieve the list of all available commands. Commands starting with an underscore are treated as internal commands.

See Also: List of all available commands in VSCode

Upvotes: 0

Bakhtiiar Muzakparov
Bakhtiiar Muzakparov

Reputation: 2438

Open command palette with Ctrl/Cmd + p and type in Open Default Keyboard Shortcuts(JSON)

then Enter or click on it

Upvotes: 3

roblingle
roblingle

Reputation: 374

Preferences > Open Keyboard Shortcuts.

Click to edit keybindings.json for advanced customization. At the bottom of keybindings.json is a list of available commands:

// Here are other available commands:

This is mentioned (but hard to find) on the page shared by seairth.

Upvotes: 14

seairth
seairth

Reputation: 2062

Look at Key Bindings for Visual Studio Code for the default list.

Upvotes: 0

Related Questions