Skip to content

Commit

Permalink
Provide pipe and <- keyboard shortcuts in Quarto files, when RStudi…
Browse files Browse the repository at this point in the history
…o Keymap is enabled (posit-dev#3523)

* Provide pipe keyboard shortcut in Quarto files, when RStudio Keymap is enabled

* Scope command to editor/console, keybindings + command palette to R files

* Also enable keybinding for Quarto with config

* Also provide left assignment keybinding for Quarto
  • Loading branch information
juliasilge authored Jun 13, 2024
1 parent c0496ce commit 9d887fb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
24 changes: 12 additions & 12 deletions extensions/positron-r/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@
"category": "R",
"title": "%r.command.insertPipe.title%",
"shortTitle": "%r.menu.insertPipe.title%",
"enablement": "editorLangId == r && editorTextFocus"
"enablement": "editorTextFocus"
},
{
"command": "r.insertPipeConsole",
"category": "R",
"title": "%r.command.insertPipe.title%",
"shortTitle": "%r.menu.insertPipe.title%",
"enablement": "editorLangId == r && positronConsoleFocused"
"enablement": "positronConsoleFocused"
},
{
"command": "r.insertLeftAssignment",
"category": "R",
"title": "%r.command.insertLeftAssignment.title%",
"shortTitle": "%r.menu.insertLeftAssignment.title%",
"enablement": "editorLangId == r && editorTextFocus"
"enablement": "editorTextFocus"
},
{
"command": "r.insertLeftAssignmentConsole",
"category": "R",
"title": "%r.command.insertLeftAssignment.title%",
"shortTitle": "%r.menu.insertLeftAssignment.title%",
"enablement": "editorLangId == r && positronConsoleFocused"
"enablement": "positronConsoleFocused"
},
{
"command": "r.insertSection",
Expand Down Expand Up @@ -325,25 +325,25 @@
"command": "r.insertPipe",
"key": "ctrl+shift+m",
"mac": "cmd+shift+m",
"when": "editorLangId == r && editorTextFocus"
"when": "editorLangId == r"
},
{
"command": "r.insertPipeConsole",
"key": "ctrl+shift+m",
"mac": "cmd+shift+m",
"when": "editorLangId == r && positronConsoleFocused"
"when": "editorLangId == r"
},
{
"command": "r.insertLeftAssignment",
"key": "alt+-",
"mac": "alt+-",
"when": "editorLangId == r && editorTextFocus"
"when": "editorLangId == r"
},
{
"command": "r.insertLeftAssignmentConsole",
"key": "alt+-",
"mac": "alt+-",
"when": "editorLangId == r && positronConsoleFocused"
"when": "editorLangId == r"
},
{
"command": "r.packageLoad",
Expand Down Expand Up @@ -407,22 +407,22 @@
{
"category": "R",
"command": "r.insertPipe",
"when": "editorLangId == r && editorTextFocus"
"when": "editorLangId == r"
},
{
"category": "R",
"command": "r.insertPipeConsole",
"when": "editorLangId == r && positronConsoleFocused"
"when": "editorLangId == r"
},
{
"category": "R",
"command": "r.insertLeftAssignment",
"when": "editorLangId == r && editorTextFocus"
"when": "editorLangId == r"
},
{
"category": "R",
"command": "r.insertLeftAssignmentConsole",
"when": "editorLangId == r && positronConsoleFocused"
"when": "editorLangId == r"
},
{
"category": "R",
Expand Down
16 changes: 16 additions & 0 deletions extensions/positron-rstudio-keymap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@
"when": "config.rstudio.keymap.enable && editorTextFocus && editorLangId == r",
"command": "r.insertSection"
},
{
"mac": "cmd+shift+m",
"win": "ctrl+shift+m",
"linux": "ctrl+shift+m",
"key": "ctrl+shift+m",
"when": "config.rstudio.keymap.enable && editorLangId == quarto",
"command": "r.insertPipe"
},
{
"mac": "alt+-",
"win": "alt+-",
"linux": "alt+-",
"key": "alt+-",
"when": "config.rstudio.keymap.enable && editorLangId == quarto",
"command": "r.insertLeftAssignment"
},
{
"mac": "ctrl+alt+left",
"win": "ctrl+alt+left",
Expand Down

0 comments on commit 9d887fb

Please sign in to comment.