READMEThis is the README for "Keybinding Eval". FeaturesEval Script Code Command In Your keybindings.json It's more powerful and simple than macro and multi-command. It can eval multiple custom script line in keybindings.json. ExampleEdit your User Keybindings.json { "key": "ctrl+shift+t", "command": "extension.keyboard_shortcut_eval", "args": {"javascript": "vscode.window.showInformationMessage('100'); vscode.commands.executeCommand('workbench.action.terminal.toggleTerminal');"} } Press CTRL + SHIFT + T, it do two work by javascript eval function. vscode.window.showInformationMessage('100'); Initial release.Enjoy! How to recreate same extension?https://code.visualstudio.com/api/get-started/your-first-extension npm install -g yo generator-code cd your workdir yo code ----(identifier all lowercase, typescript type) cd project-dir code . extesion.tsimport * as vscode from 'vscode'; export function activate(context: vscode.ExtensionContext) { let disposable = vscode.commands.registerCommand('extension.keyboard_shortcut_eval', (args) => { if(args && args.javascript && typeof args.javascript == "string") { eval(args.javascript); } else{ let str = `(Pleas copy this message text) Extension.keyboard_shortcut_eval command need set keyboard shortcut command args, args object key=javascript, keybindings.json example: "command": "extension.keyboard_shortcut_eval", "args": {"javascript": "vscode.window.showInformationMessage('100'); vscode.commands.executeCommand('workbench.action.terminal.toggleTerminal');"}`; vscode.window.showInformationMessage(str); } }); context.subscriptions.push(disposable); } export function deactivate() {} ctrl+shift+b npm watch && F5 testPublish your extensionhttps://code.visualstudio.com/api/working-with-extensions/publishing-extension My first extension, about 4 hours worktime.You can recreate this extension in 1 hour. See above. |