-
Notifications
You must be signed in to change notification settings - Fork 1
/
06_tips_index.Rmd
85 lines (71 loc) · 3.85 KB
/
06_tips_index.Rmd
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: "Tips Index"
subtitle: "Part 6 of the RStudio Tips and Tricks Series"
author: "Jeremy Allen"
date: "Nov 2, 2021, updated on `r Sys.Date()`"
output:
html_document:
highlight: zenburn
theme:
bg: "#303436"
fg: "#9da9af"
primary: "#ff8080"
base_font:
google: "Roboto"
code_font:
google: "JetBrains Mono"
editor_options:
chunk_output_type: console
self_contained: true
---
------------------------------------------------------------------------
```{r message=FALSE, warning=FALSE, include=FALSE}
library(bslib)
```
<br>
<br>
# List of all `r emo::ji("smile")` pro tips from the series
## Settings
`r emo::ji("smile")` Pro tip: cmd+, to access global options and do all sorts of things like change appearance, change layout, set up package repos, git, Python interpreter and more!
`r emo::ji("smile")` Pro tip: If you are on a Linux server, see what operating system you are on by running this in your console:
`system("lsb_release -a")`
`r emo::ji("smile")` Pro tip: Set [RStudio Public Package Manager](https://packagemanager.rstudio.com/client/) as your repo
`r emo::ji("smile")` Pro tip: shift+cmd+p for the command palette, then do anything
## General
`r emo::ji("smile")` Pro tip: ctl+shift+o to navigate your document with the outline
`r emo::ji("smile")` Pro tip: in the console type a couple of letters then cmd+up for visual of matches
`r emo::ji("smile")` Pro tip: open file in new column is great for Shiny apps when you have ui, sever, and css files
`r emo::ji("smile")` Pro tip: highlight multiple lines of code, shift+ctl+c to comment all
`r emo::ji("smile")` Pro tip: alt+up or alt+down to move lines
`r emo::ji("smile")` Pro tip: ctl+alt+down or ctl+alt+up to have multi-line cursor
`r emo::ji("smile")` Pro tip: double click one of the parentheses to highlight what it contains
`r emo::ji("smile")` Pro tip: cmd+i to fix bad indentation
`r emo::ji("smile")` Pro tip: cmd+shift+m to insert pipe
`r emo::ji("smile")` Pro tip: alt+dash for assignment arrow
`r emo::ji("smile")` Pro tip: cmd+f for find (and replace)
## Jobs
`r emo::ji("smile")` Pro tip: execute code or scripts as jobs in separate R sessions so you can keep working in your IDE
## Git
`r emo::ji("smile")` Pro tip: ctl+alt+m to open the git commit window
`r emo::ji("smile")` Pro tip: can stage or discard chunks, even lines
`r emo::ji("smile")` Pro tip: select first file then cmd+a to highlight all, then check one to check all
## Regex
`r emo::ji("smile")` Pro tip: match anything that you put in []
`r emo::ji("smile")` Pro tip: str_view() to see string matches (requires htmlwidgets)
## Snippets
`r emo::ji("smile")` Pro tip: shift+tab to expand a snippet
`r emo::ji("smile")` Pro tip: type fun then shift+tab or shiny then shift+tab
`r emo::ji("smile")` Pro tip: If you are new to ggplot2, you can install the esquisse package, which also installs the ggplot2 builder addin, which you can use to build a plot using a GUI, then have the code, too!
## Functions
`r emo::ji("smile")` Pro tip: cmd+click on a function name to inspect it's body
`r emo::ji("smile")` Pro tip: combine some functions into one function using purrr::compose()
`r emo::ji("smile")` Pro tip: highlight code, then in Code menu, select extract function
## Search
`r emo::ji("smile")` Pro tip: ctl+. to search file tabs
`r emo::ji("smile")` Pro tip: shift+cmd+f to search and replace across many files, also under Edit menu
`r emo::ji("smile")` [Google Programmable Search Engine](https://programmablesearchengine.google.com/about/)
------------------------------------------------------------------------
All code for the RStudio Tips and Tricks Series is on GitHub at
<https://github.com/jeremy-allen/rstudio-tips>
Slides for the RStudio Tips and Tricks Series are available
<https://jeremy-allen.github.io/rstudio-tps/>