Skip to content

Commit ad08a42

Browse files
Move RStudio keybindings to a section to assist migration (#69)
* Move RStudio keybindings to a section to assist migration Several uses did not know that RStudio keybindings were available in Positron. Also, since these were recently moved from a keymap extension to core keybinding settings in posit-dev/positron#7362, fixing the documentation to reflect their new location. * Update keyboard-shortcuts.qmd Co-authored-by: Julia Silge <[email protected]> * Update rstudio-keybindings.qmd Co-authored-by: Julia Silge <[email protected]> --------- Co-authored-by: Julia Silge <[email protected]>
1 parent 7cad673 commit ad08a42

File tree

3 files changed

+41
-30
lines changed

3 files changed

+41
-30
lines changed

_quarto.yml

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ website:
7878
- extension-development.qmd
7979
- section: "Migrating from RStudio"
8080
contents:
81+
- rstudio-keybindings.qmd
8182
- rstudio-rproj-file.qmd
8283
- r-snippets.qmd
8384

keyboard-shortcuts.qmd

+2-30
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,9 @@ Positron's keyboard shortcuts, with a few exceptions, are a superset of the keyb
2929
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd> | Check the current R package, if any |
3030
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> | Document the current R package, if any |
3131

32-
## RStudio keymap
32+
## RStudio keybindings
3333

34-
If you'd prefer to use RStudio keybindings, do the following:
35-
36-
- Open Positron's settings via <kbd>Cmd/Ctrl</kbd>+<kbd>,</kbd>
37-
- Search for "keymap", or navigate to *Extensions > RStudio Keymap*
38-
- Check the "Enable RStudio key mappings for Positron" checkbox
39-
40-
The following RStudio keymappings will then be enabled:
41-
42-
| Shortcut | Description |
43-
| -------- | ----------- |
44-
| <kbd>Ctrl</kbd>+<kbd>1</kbd> | Focus Source |
45-
| <kbd>Ctrl</kbd>+<kbd>2</kbd> | Focus Console |
46-
| <kbd>Cmd/Ctrl</kbd>+<kbd>.</kbd> | Go to Symbol |
47-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>C</kbd> | Comment/Uncomment a line |
48-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd> | Create a new R file |
49-
| <kbd>F2</kbd> | Go to definition |
50-
| <kbd>Cmd/Ctrl</kbd>+<kbd>I</kbd> | Reindent selection |
51-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> | Reformat selection |
52-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd> | Source the current R script |
53-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd> | Rename |
54-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>I</kbd> | Insert a new Quarto/R Markdown cell |
55-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>M</kbd> | Open version control pane |
56-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Left</kbd> | Go to previous tab |
57-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Right</kbd> | Go to next tab |
58-
| <kbd>Cmd/Ctrl</kbd>+<kbd>D</kbd> | Delete the current line |
59-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd> | Insert pipe operator |
60-
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd> | Insert section |
61-
| <kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>K</kbd> | Open global keybindings list |
62-
| <kbd>Alt</kbd>+<kbd>-</kbd> | Insert left assignment operator `<-` |
34+
If you'd prefer to use RStudio keybindings, see [our instructions](rstudio-keybindings.qmd) on how to enable them for Positron.
6335

6436
## Custom shortcuts
6537

rstudio-keybindings.qmd

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "RStudio Keybindings"
3+
---
4+
5+
<!-- vale Posit.Contractions = NO -->
6+
7+
## RStudio keybindings in Positron
8+
9+
If you'd prefer to use RStudio keybindings in Positron, do the following:
10+
11+
- Open Positron's settings via <kbd>Cmd/Ctrl</kbd>+<kbd>,</kbd>
12+
- Search for "RStudio", or navigate to *Workbench > Keybindings > RStudio Keybindings*
13+
- Check the "Enable RStudio keybindings" checkbox
14+
- Restart Positron
15+
16+
The following RStudio keybindings will then be enabled:
17+
18+
| Shortcut | Description |
19+
| -------- | ----------- |
20+
| <kbd>Ctrl</kbd>+<kbd>1</kbd> | Focus Source |
21+
| <kbd>Ctrl</kbd>+<kbd>2</kbd> | Focus Console |
22+
| <kbd>Cmd/Ctrl</kbd>+<kbd>.</kbd> | Go to Symbol |
23+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>C</kbd> | Comment/Uncomment a line |
24+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd> | Create a new R file |
25+
| <kbd>F2</kbd> | Go to definition |
26+
| <kbd>Cmd/Ctrl</kbd>+<kbd>I</kbd> | Reindent selection |
27+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> | Reformat selection |
28+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd> | Source the current R script |
29+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd> | Rename |
30+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>I</kbd> | Insert a new Quarto/R Markdown cell |
31+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>M</kbd> | Open version control pane |
32+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Left</kbd> | Go to previous tab |
33+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Right</kbd> | Go to next tab |
34+
| <kbd>Cmd/Ctrl</kbd>+<kbd>D</kbd> | Delete the current line |
35+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd> | Insert pipe operator |
36+
| <kbd>Cmd/Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd> | Insert section |
37+
| <kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>K</kbd> | Open global keybindings list |
38+
| <kbd>Alt</kbd>+<kbd>-</kbd> | Insert left assignment operator `<-` |

0 commit comments

Comments
 (0)