简体   繁体   中英

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

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.

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

then Enter or click on it

查看Visual Studio Code 的键绑定以获取默认列表。

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

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