Skip to content

Instantly share code, notes, and snippets.

@strengejacke
Last active July 1, 2024 21:53
Show Gist options
  • Save strengejacke/2a785f8e096d94bc84fb6b877aad4fb1 to your computer and use it in GitHub Desktop.
Save strengejacke/2a785f8e096d94bc84fb6b877aad4fb1 to your computer and use it in GitHub Desktop.
Positron-Setup
{
// this is the settings.json file
// file behaviour
"files.hotExit": "onExitAndWindowClose",
"files.defaultLanguage": "r",
// positron and workbench
"workbench.colorTheme": "Default Dark Modern",
"positron.r.diagnostics.enable": false,
// editor settings
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.formatOnPaste": true,
"editor.guides.bracketPairs": "active",
"editor.guides.indentation": false,
"editor.cursorBlinking": "phase",
"editor.rulers": [
{"column": 80, "color": "#5a5a5a80"}, // right rule
{"column": 95, "color": "#5a5a5a30"}, // right rule
{"column": 120, "color": "#5a5a5a40"} // extra right rule
],
// todo tree
"todo-tree.highlights.customHighlight": {
"TODO": {
"background": "#F5910044",
"foreground": "#fffc00FF"
},
"BUG": {
"icon": "bug",
"background": "#D3262655",
"foreground": "#FF3300FF"
},
"HACK": {
"icon": "tools"
},
"FIXME": {
"icon": "flame",
"background": "#00996844",
"foreground": "#25D366FF"
}
},
// git settings
"git.autofetch": true,
"git.confirmSync": false,
"git.suggestSmartCommit": false,
// github settings
"githubPullRequests.fileListLayout": "tree",
"githubPullRequests.defaultMergeMethod": "squash",
"githubPullRequests.pullBranch": "never",
// Codesnap
"codesnap.boxShadow": "rgba(0, 0, 0, 0.55) 0px 20px 60px",
"codesnap.backgroundColor": "#6090a0",
"codesnap.containerPadding": "1em",
"codesnap.showWindowControls": false,
"codesnap.shutterAction": "copy",
// Debugger
"debug.toolBarLocation": "docked"
}
@strengejacke
Copy link
Author

strengejacke commented Jul 1, 2024

Keyboard Shorcuts

// Place your key bindings in this file to override the defaults
[
    // build source package
    {
        "key": "ctrl+shift+b",
        "command": "r.packageBuild",
        "when": "isRPackage"
    },
    // install package (for developers)
    {
        "key": "ctrl+shift+i",
        "command": "r.packageInstall",
        "when": "isRPackage"
    },
    // jump to function
    {
        "key": "ctrl+oem_period",
        "command": "workbench.action.showAllSymbols"
    },
    // create reprex from selection
    {
        "key": "ctrl+shift+x",
        "command": "workbench.action.executeCode.console",
        "when": "editorTextFocus",
        "args": {
            "langId": "r",
            "code": "reprex::reprex_selection()",
            "focus": true
        }
    },

    // remove default 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+shift+b",
        "command": "-r.packageInstall",
        "when": "isRPackage"
    },
    {
        "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"
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment