Skip to content
Discussion options

You must be logged in to vote

Hi @skybrian

I'm not aware that there is a direct API in VS Code for querying the current keybindings from within an extension.

However, you can consider the following workaround to accomplish this:

  1. Load Keybindings from User Settings:

    • VS Code stores its keybindings in a JSON file. The extension can read the user's keybindings by loading the keybindings.json file from the user's settings directory. The path to this file can vary based on the platform (Windows, Mac, or Linux).

    • Once you've read the file, you can search within the JSON data for the command you're interested in and then extract the keybinding.

  2. Keep a Default Text:

    If you're unable to determine the custom keybinding …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kschaab
Comment options

Answer selected by theReynald
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants