-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathkeyboard-shortcuts.qmd
63 lines (44 loc) · 2.52 KB
/
keyboard-shortcuts.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Keyboard Shortcuts
{title="The key caps use LCD displays for all the vowels, so they can automatically adjust over the years to reflect ongoing vowel shifts while allowing you to keep typing phonetically."}
Keyboard shortcuts tend to make our lives easier. Some that you might already be familiar with in day to day life are: quickly saving (Cmd + S or Ctrl + S), or Undo (Cmd + Z or Ctrl + Z).
There are many keyboard shortcuts you can access in R, this section provides a brief tour of them, and why you might want to use them.
## Overview
* **Teaching** 5 minutes
* **Exercises** 5 minutes
## Questions
* What sort of keyboard shortcuts should I care about?
## Objectives
<!-- TODO -->
<!-- ## Gifs of the action -->
<!-- ### render document -->
<!-- ### Insert Chunk -->
<!-- ### Run Current Chunk -->
<!-- ### Jump to -->
<!-- ### Create multiple cursors -->
<!-- ### Delete the current line -->
<!-- ### Un/Comment out a line -->
<!-- ### Reformat Section -->
<!-- ### Show Keyboard Shortcut Reference -->
## Table of Common Shortcuts
Below is a small table of tasks you can perform with keyboard
| Action | Windows/Linux | Mac |
|-------------|---------------|----------------|
| Knit document | Ctrl + Shift + K | Cmd + Shift + K |
| Insert Chunk | Ctrl + Alt + I | Cmd + Option + I |
| Run Current Chunk | Ctrl + Alt + C | Cmd + Option + C |
| Jump to Shift+Alt+J | Cmd+Shift+Option+J |
| Show Keyboard Shortcut Reference | Alt+Shift+K | Option+Shift+K |
| Create multiple cursors | Ctrl + Alt + Up/Down | option + control + Up/Down|
| Delete the current line | Ctrl + D | Cmd + D|
| Un/Comment out a line | Ctrl + Shift + C | Cmd + Shift + C|
| Reformat Section | Ctrl + Shift + A | Cmd + Shift + A|
## Further Reading
- The [Rstudio Cheat Sheet](https://rstudio.github.io/cheatsheets/html/rstudio-ide.html#keyboard-shortcuts) has an index of shortcuts.
- This [help file](https://support.posit.co/hc/en-us/articles/206382178-Customizing-Keyboard-Shortcuts-in-the-RStudio-IDE) has a guide to customising keyboard shortcuts.
- The [shrtcts](https://github.com/gadenbuie/shrtcts) R package for creating new shortcuts.
::: {.callout-note title="Your Turn"}
- In your **awesome** quarto document
- Oractice using the Keyboard Shortcut Reference and find the keyboard shortcut for inserting a pipe character ( `%>%` or `|>`)
- Spend 3 minutes practicing these commands.
- Ask Nick to demonstrate some of his favourite shortcut combos
:::