Keyboard Shortcuts

Positron’s keyboard shortcuts, with a few exceptions, are a superset of the keyboard shortcuts used by Visual Studio Code. This table lists the shortcuts specifically added for Positron.

Note

Our documentation shows you keyboard shortcuts based on your operating system. For example, if you visit this page using Windows, you will see keyboard shortcuts for Windows. Hover your mouse over the keyboard shortcut to see the information for other platforms.

Global shortcuts

Shortcut Description

Run the selected code in the editor; if no code is selected, run the current statement

Restart the interpreter currently open in the Console

Run the file open in the editor (using e.g. source() or %run)

F1

Show contextual help for the topic under the cursor
, Show contextual help for the topic under the cursor (alternate binding)
, F Focus the Console
, V Focus the Variables pane

Ctrl-L

Clear the Console

R shortcuts

Shortcut Description

Insert the pipe operator (|> or %>%)

Insert the assignment operator (<-)

Load the current R package, if any

Build and install the current R package, if any

Test the current R package, if any

Check the current R package, if any

Document the current R package, if any

RStudio keybindings

If you’d prefer to use RStudio keybindings, see our instructions on how to enable them for Positron.

Custom shortcuts

Because Positron is built on top of VS Code, you can use its infrastructure for defining custom keybindings. You can use this infrastructure with any Positron-specific commands, such as workbench.action.executeCode.console or workbench.action.executeCode.silently.

As a specific example, you could add the following to your user keybindings.json (access this file from the Command Palette with Open Keyboard Shortcuts (JSON)) to make a keyboard shortcut to create a reprex from your current selection:

{
    "key": "Cmd+Shift+R",
    "command": "workbench.action.executeCode.console",
    "when": "editorTextFocus",
    "args": {
        "langId": "r",
        "code": "reprex::reprex_selection()",
        "focus": true
    }
}

Be aware that Positron’s integrated terminal can intercept some keyboard shortcuts. You can set up a keybinding to skip the shell by specifying its command in the terminal.integrated.commandsToSkipShell setting, either via the settings UI or by editing settings.json:

{
    "terminal.integrated.commandsToSkipShell": [
        // Ensure the keyboard shortcut for focusing the console skips the shell
        "workbench.action.positronConsole.focusConsole"
    ]
}