With vscode v1.77 Insiders now (Stable next week) you can run a sequence of commands WITHOUT an extension. This keybinding would do what you want:
{
"key": "alt+c", // choose your keybinding
"command": "runCommands",
"args": {
"commands": [
"editor.action.copyLinesDownAction",
"cursorUp",
"editor.action.addCommentLine",
"cursorDown"
]
}
}
For more, see How can I run multiple commands with a single VS Code keybinding without an extension?
[Before vscode v1.77]
You need a macro extension like multi-command so you can run a sequence of commands. There are other macro extensions out there. Using multi-command:
In settings.json:
"multiCommand.commands": [
{
"command": "multiCommand.commentDown",
"sequence": [
"editor.action.copyLinesDownAction",
"cursorUp",
"editor.action.addCommentLine",
"cursorDown"
]
}
]
The commands can be found in the Keyboard Shortcuts listing. Search on SO for "multi-command" to see some of things you can do with it. (I have no connection to it.)
Choose a keybinding in keybindings.json:
{
"key": "ctrl+shift+/",
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.commentDown" },
"when": "editorTextFocus"
},