Post

Setting language-specific Visual Studio Code keybindings

Keybindings can be set for specific languages and specific contexts.

E.g.:

1
2
3
4
5
6
    {
        "key": "ctrl+e",
        "command": "mssql.runQuery",
        "when": "editorTextFocus && editorLangId == 'sql'",
        "args": "Run SQL query"
    },

The list of available commands for an extension (e.g. the mssql extension) can be found by by viewing the list under Features>Commands when looking at the extension (File>Preferences>Extensions).

Ref.

This post is licensed under CC BY 4.0 by the author.