Skip to content

Instantly share code, notes, and snippets.

@mschmidty
Created February 15, 2023 19:12
Show Gist options
  • Save mschmidty/784d19179b7923e057e780cd1f7f83ed to your computer and use it in GitHub Desktop.
Save mschmidty/784d19179b7923e057e780cd1f7f83ed to your computer and use it in GitHub Desktop.
VS Code keybindings for R development windows
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+alt+i",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "```{r}\n$0\n```",
}
},
{
"key": "ctrl+alt+o",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "options(\n max.print=50,\n vsc.use_httpgd = TRUE,\n device = 'windows'\n)"
}
},
{
"key": "ctrl+alt+m",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args":{
"snippet": "---\ntitle: '$0'\nauthor: 'Michael Schmidt'\ndate: '`r Sys.Date()`'\noutput:\n pagedown::html_paged:\n self_contained: false\n toc: false\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk\\$set(\n echo = FALSE,\n message = FALSE,\n warning=FALSE\n)\n```"
}
},
{
"key": "ctrl+shift+m",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "tar_make()\u000D"
}
},
{
"key": "ctrl+shift+l",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "tar_load_everything()\u000D"
}
},
{
"key": "shift+alt+.",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "|>\n$0",
}
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment