Last active
April 28, 2023 16:47
-
-
Save searls/4cb712eebc7263f8ae37bace7f51867e to your computer and use it in GitHub Desktop.
VS Code 1.77 added the `runCommands` command, which is basically a macro that you can define right in your keybindings file by chaining multiple commands together. In this case I bound individual test runs, file-scoped tests, and full Rake tasks to command-R + modifiers. (The `m` CLI is the m gem, which allows running minitests by file and line)…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"command": "runCommands", | |
"key": "cmd-r", | |
"args": { | |
"commands": [ | |
"workbench.action.files.save", | |
"workbench.action.terminal.focus", | |
{ | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { | |
"text": "bundle exec m ${relativeFile}:${lineNumber}\u000D" | |
} | |
}, | |
"workbench.action.focusActiveEditorGroup" | |
] | |
} | |
}, | |
{ | |
"command": "runCommands", | |
"key": "cmd-shift-r", | |
"args": { | |
"commands": [ | |
"workbench.action.files.save", | |
"workbench.action.terminal.focus", | |
{ | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { | |
"text": "bundle exec m ${relativeFile}\u000D" | |
} | |
}, | |
"workbench.action.focusActiveEditorGroup" | |
] | |
} | |
}, | |
{ | |
"command": "runCommands", | |
"key": "cmd-alt-shift-r", | |
"args": { | |
"commands": [ | |
"workbench.action.files.save", | |
"workbench.action.terminal.focus", | |
{ | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { | |
"text": "bundle exec rake\u000D" | |
} | |
}, | |
"workbench.action.focusActiveEditorGroup" | |
] | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment