Skip to content

Instantly share code, notes, and snippets.

@JosiahParry
Created June 27, 2024 21:46
Show Gist options
  • Save JosiahParry/f254923b2c75ea32db28de07fb755a7e to your computer and use it in GitHub Desktop.
Save JosiahParry/f254923b2c75ea32db28de07fb755a7e to your computer and use it in GitHub Desktop.
Positron Keybindings
// Place your key bindings in this file to override the defaults
[
{
"key": "shift+cmd+b",
"command": "workbench.action.tasks.runTask",
"args": "Build R package",
"when": "isRPackage"
},
{
"key": "shift+cmd+enter",
"command": "workbench.action.tasks.runTask",
"args": "Check extendr package",
"when": "isRPackage && editorLangId == 'rust'",
},
{
"key": "shift+cmd+d",
"command": "workbench.action.tasks.runTask",
"args": "rextendr::document()",
"when": "isRPackage"
},
{
"key": "Alt+tab",
"command": "workbench.action.executeCode.silently",
"description": "Reshape expressions longer or wider",
"when": "editorTextFocus",
"args": {
"langId": "r",
"code": "codegrip::addin_reshape()"
}
},
{
"key": "ctrl+1",
"command": "workbench.action.focusActiveEditorGroup",
},
{
"key": "cmd+escape",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "ctrl+`",
"command": "-workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "shift+cmd+m",
"command": "r.insertPipe",
"when": "editorTextFocus && editorLangId == 'r' || editorLangId == 'quarto'"
},
{
"key": "shift+cmd+m",
"command": "-r.insertPipe",
"when": "editorTextFocus && editorLangId == 'r'"
}
]
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"env": {
"NOT_CRAN": "true"
}
},
"tasks": [
{
"label": "Build R package",
"type": "shell",
"command": "R CMD install --preclean --no-multiarch --with-keep.source .",
"problemMatcher": [
"$rustc"
]
},
{
"label": "Build as CRAN",
"type": "shell",
"command": "R CMD install --preclean --no-multiarch --with-keep.source .",
"problemMatcher": [
"$rustc"
],
"options": {
"env": {
"NOT_CRAN": "false"
}
}
},
{
"label": "Check extendr package",
"type": "shell",
"command": "cargo check --all-features --manifest-path=src/rust/Cargo.toml",
},
{
"label": "cargo check",
"type": "shell",
"command": "cargo check --all-features"
},
{
"label": "cargo run",
"type": "shell",
"command": "cargo run"
},
{
"label": "rextendr::document()",
"type": "shell",
"command": "R -e 'rextendr::document()'"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment