Do we have something in RStudio like the SAS Enterprise Guide editor abbreviations (https://blogs.sas.com/content/sasdummy/2011/11/17/sas-program-editor-abbrevs/)?
For those who don't know, they are a "template" code snippet that can be auto-completed by typping the abbreviation/shortcut. It's really useful when some block of code is often used or when it's hard to remember the syntax.
For example, I could define the shortcut "pp" to:
ggplot(df,aes(x=x, y=y)) +
geom_point() +
theme(plot.title = element_text(size = 16),
axis.text.x = element_text(angle=90, hjust=1)) +
theme_light() +
labs(x = "X",
y = "Y") +
ggtitle("TITLE")
And insert it automatically by just typing "pp" + TAB.