Last active
November 9, 2024 09:43
-
-
Save strengejacke/2a785f8e096d94bc84fb6b877aad4fb1 to your computer and use it in GitHub Desktop.
Positron-Setup
This file contains 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
Positron Version: 2024.11.0 (system setup) build 140 | |
Code - OSS Version: 1.93.0 | |
Commit: e0d844b031f95acbf89f234a2cce2af9b6721f6c | |
Date: 2024-10-31T14:14:22.699Z | |
Electron: 30.4.0 | |
Chromium: 124.0.6367.243 | |
Node.js: 20.15.1 | |
V8: 12.4.254.20-electron.0 | |
OS: Windows_NT x64 10.0.22631 |
Keybindings
// Place your key bindings in this file to override the defaults
[
// Install R package (for developers)
{
"description": "R Install Package",
"key": "ctrl+shift+i",
"command": "workbench.action.executeCode.console",
"args": "devtools::install(quick = TRUE, upgrade = FALSE)",
"when": "isPackage || ((editorTextFocus || positronConsoleFocused) && editorLangId == 'r')"
},
// build source package
{
"description": "R Build Source Package",
"key": "ctrl+shift+b",
"command": "r.packageBuild",
"when": "isRPackage"
},
// Update packages
{
"description": "R Update Packages",
"key": "ctrl+shift+u",
"command": "workbench.action.executeCode.console",
"args": "vsCodeSnippets::update_R_packages()",
"when": "editorTextFocus || positronConsoleFocused"
},
// create reprex from selection
{
"description": "R Create Reprex from Selection",
"key": "ctrl+shift+x",
"command": "workbench.action.executeCode.console",
"when": "editorTextFocus",
"args": {
"langId": "r",
"code": "reprex::reprex_selection()",
"focus": true
}
},
// Compile report (knit R Script)
{
"description": "R Compile Report",
"key": "ctrl+shift+r",
"command": "workbench.action.executeCode.console",
"args": "rmarkdown::render(input=rstudioapi::getSourceEditorContext()$path)",
"when": "editorLangId == 'r'"
},
// workspace/workbench shortcuts
{
"key": "ctrl+oem_period",
"command": "workbench.action.showAllSymbols"
},
{
"key": "ctrl+2",
"command": "workbench.action.positronConsole.focusConsole"
},
{
"key": "ctrl+3",
"command": "workbench.action.positron.togglePlots"
},
{
"key": "ctrl+4",
"command": "workbench.action.positron.togglePreview",
"when": "workbench.panel.positronPreview.active"
},
{
"key": "ctrl+shift+j",
"command": "workbench.action.toggleAuxiliaryBar"
},
// editor shortcuts
{
"key": "ctrl+shift+c",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+a",
"command": "editor.action.formatSelection",
"when": "editorTextFocus"
},
{
"key": "ctrl+oem_5",
"command": "editor.action.jumpToBracket",
"when": "editorTextFocus"
},
// remove preset keybindings
{
"key": "ctrl+shift+n",
"command": "-r.createNewFile",
"when": "config.rstudio.keymap.enable"
},
{
"key": "ctrl+shift+i",
"command": "-positron.insertCodeCell",
"when": "editorTextFocus && positron.supportsCodeCells && !findInputFocussed && !replaceInputFocussed"
},
{
"key": "ctrl+oem_period",
"command": "-workbench.action.showAllSymbols",
"when": "config.rstudio.keymap.enable"
},
{
"key": "ctrl+t",
"command": "-workbench.action.showAllSymbols"
},
{
"key": "ctrl+shift+x",
"command": "-workbench.view.extensions",
"when": "viewContainer.workbench.view.extensions.enabled"
},
{
"key": "ctrl+shift+b",
"command": "-r.packageInstall",
"when": "isRPackage"
},
{
"key": "ctrl+2",
"command": "-workbench.action.focusSecondEditorGroup"
},
{
"key": "ctrl+2",
"command": "-workbench.action.positronConsole.focusConsole",
"when": "config.rstudio.keymap.enable"
},
{
"key": "ctrl+shift+a",
"command": "-editor.action.formatSelection",
"when": "config.rstudio.keymap.enable && editorTextFocus"
},
{
"key": "ctrl+shift+a",
"command": "-notification.acceptPrimaryAction",
"when": "notificationFocus || notificationToastsVisible"
},
{
"key": "ctrl+shift+c",
"command": "-editor.action.commentLine",
"when": "config.rstudio.keymap.enable && editorTextFocus"
},
{
"key": "ctrl+shift+c",
"command": "-workbench.action.terminal.openNativeConsole",
"when": "!terminalFocus"
},
{
"key": "f2",
"command": "-editor.action.revealDefinition",
"when": "config.rstudio.keymap.enable && editorHasDefinitionProvider && editorTextFocus"
},
{
"key": "ctrl+shift+u",
"command": "-workbench.action.output.toggleOutput",
"when": "workbench.panel.output.active"
},
{
"key": "ctrl+shift+u",
"command": "-workbench.action.output.toggleOutput",
"when": "workbench.panel.output.active"
},
{
"key": "ctrl+shift+j",
"command": "-workbench.action.search.toggleQueryDetails",
"when": "inSearchEditor || searchViewletFocus"
},
{
"key": "ctrl+oem_5",
"command": "-workbench.action.splitEditor"
},
{
"key": "ctrl+shift+oem_5",
"command": "-editor.action.jumpToBracket",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+r",
"command": "-r.insertSection",
"when": "config.rstudio.keymap.enable && editorTextFocus && editorLangId == 'r'"
},
{
"key": "ctrl+shift+r",
"command": "-editor.action.refactor",
"when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+i",
"command": "-workbench.action.toggleDevTools",
"when": "isDevelopment"
},
{
"key": "ctrl+4",
"command": "-workbench.action.focusFourthEditorGroup"
},
{
"key": "ctrl+3",
"command": "-workbench.action.focusThirdEditorGroup"
},
{
"key": "ctrl+shift+h",
"command": "-workbench.action.positron.togglePreview"
},
{
"key": "ctrl+alt+b",
"command": "-workbench.action.toggleAuxiliaryBar"
}
]
Layout
I prefer 3-column layout, with editor in the center, output/console on the right, and a small left sidebar for files/navigation etc. If required, the bottom panel with variables ("Environment") can be shown/hidden via shortcut.
positron-layout.mp4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
settings.json