My Positron Setup Guide
Abstract
Guidance on setting up a fresh Positron installation.
Introduction
This is one of a series of posts where I document software configurations for personal reference. This post documents the configurations for Positron.
Extensions
Databot:- In positron:
ctrl + p->ext install posit.databot.
- In positron:
GitLens:- In positron:
ctrl + p->ext install eamodio.gitlens.
- In positron:
Mermaid Chart:- In positron:
ctrl + p->ext install mermaidchart.vscode-mermaid-chart.
- In positron:
pastum:- In positron:
ctrl + p->ext install atsyplenkov.pastum.
- In positron:
shellcheck:- In shell:
sudo apt install shellcheck. - In positron:
ctrl + p->ext install timonwong.shellcheck.
- In shell:
shell-format:- Download shfmt executable binary, rename it as
shfmt, save it to/usr/local/bin/, and make it executable. - In positron:
ctrl + p->ext install foxundermoon.shell-format.
- Download shfmt executable binary, rename it as
SQL Formatter VSCode:- In positron:
ctrl + p->ext install renesaarsoo.sql-formatter-vsc
- In positron:
sqltools:- In positron:
ctrl + p->ext install mtxr.sqltools
- In positron:
Settings
Go to “Preferences” - “Settings” and change the following settings:
- Text Editor
- Tab Size:
2 - Word Wrap:
"on" - Find
- Auto Find In Selection:
"multiline"
- Auto Find In Selection:
- Font
- Font Family:
'Ubuntu Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'
- Font Family:
- Formatting
- Format On Save:
true
- Format On Save:
- Suggestion
- Accept Suggestion On Enter:
"off"
- Accept Suggestion On Enter:
- Files
- Auto Guess Encoding:
true
- Auto Guess Encoding:
- Tab Size:
- Workbench
- Color Theme:
"Positron Dark"
- Color Theme:
- Features
- Extensions
- Auto Check Updates:
false - Auto Update:
None - Ignore Recommendations:
true
- Auto Check Updates:
- Terminal
- Integrated: Cursor Blinking:
true - Integrated: Enable Visual Bell:
true - Integrated: Scrollback:
10000
- Integrated: Cursor Blinking:
- Extensions
- Application:
- Proxy:
- Proxy:
socks5://127.0.0.1:1080
- Proxy:
- Proxy:
- Security
- Workspace
- Trust: Untrusted Files:
"open"
- Trust: Untrusted Files:
- Workspace
- Extensions:
- Databot:
- Research Preview Acknowledgment:
Acknowledged
- Research Preview Acknowledgment:
- shell-format configuration
- Shellformat: Path:
"/usr/local/bin/shfmt"
- Shellformat: Path:
- Positron Assistant:
- Assistant: Enable:
true
- Assistant: Enable:
- SQL Formatter:
- Data Type Case:
upper - Function Case:
upper - Identifier Case:
lower - Keyword Case:
upper
- Data Type Case:
- Databot:
Keybindings
Go to “Preferences” - “Keyboard Shortcuts” and change the following shorcuts:
- Reindent Selected Lines:
Ctrl + KCtrl + IwheneditorTextFocus && !editorReadonly(remove conflicting keybinding for “Show or Focus Hover”)
Useful shortcuts that use default:
- Change Language Mode:
Ctrl + KM - Console: Execute Code:
Ctrl + Enter - File: New Untitled Text File:
Ctrl + N - File: Open Folder:
Ctrl + KCtrl + O - Format Selection:
Ctrl + KCtrl + F - Help: Show Help at Cursor:
F1 - Quarto: Insert Code Cell:
Ctrl + Shift + I - R: Insert the pipe operator:
Ctrl + Shift + M - Show All Commands:
Ctrl + Shift + P - Toggle Line Comment:
Ctrl + / - View: Split Editor:
Ctrl + \ - View: Copy Editor into New Window:
Ctrl + K O
Snippets
Go to “Preferences” - “Configure Snippets” and add the following snippets:
r:
"httr2-request": {
"prefix": "httr2-request",
"body": [
"library(httr2)",
"",
"req <- request(\"$1\") |>",
"\treq_method(\"${2:POST}\") |>",
"\treq_headers(",
"\t\tAuthorization = \"${3}\",",
"\t\t`Content-Type` = \"application/json\"",
"\t) |>",
"\treq_body_json(",
"\t\tlist()",
"\t)",
"",
"resp <- req |>",
"\treq_perform()",
"",
"resp |>",
"\tresp_body_json()",
""
]
}