Skip to content

Instantly share code, notes, and snippets.

@avogel3
Last active June 16, 2020 15:21
Show Gist options
  • Save avogel3/5b55ea5b40acff4a124ef8e140232cff to your computer and use it in GitHub Desktop.
Save avogel3/5b55ea5b40acff4a124ef8e140232cff to your computer and use it in GitHub Desktop.
VSCode Keybindings Rails
// Place your key bindings in this file to override the defaults
// TODO: Only in spec files, open terminal if one not open?
// NOTE: [ctrl+t] Run the currently focused rspec test file when the editor languageId is ruby
// NOTE: [ctrl+y] Run the rspec test file on the current line number under the cursor
[
{
"key": "ctrl+t",
"command": "workbench.action.terminal.sendSequence",
"when": "editorTextFocus && editorLangId == ruby",
"args": {
"text": "bundle exec rspec ${file}\u000D"
}
},
{
"key": "ctrl+y",
"command": "workbench.action.terminal.sendSequence",
"when": "editorTextFocus && editorLangId == ruby",
"args": {
"text": "bundle exec rspec ${file}:${lineNumber}\u000D"
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment