When writing an RMarkdown file in RStudio, I'd like to be able to insert common text snippets using a keyboard shortcut. On the one hand, there are code snippets in RStudio, but they don't seem to work for Markdown. So I'd settle for any other way to create a custom keyboard shortcut for inserting a pre-specified piece of custom text, while I wait for that bug to be fixed.
Asked
Active
Viewed 1,322 times
1 Answers
4
Turns out you can use code snippets in Markdown in RStudio. Although they don't seem to work at first, you can force snippet expansion using Shift+Tab, as described here. The RStudio team says they'll add that to the official documentation in the future.

Nathan
- 1,451
- 1
- 15
- 28
-
This doesn't work outside of chunks for me – Samuel Allain May 06 '22 at 16:26
-
I found a solution [here](https://stackoverflow.com/questions/42161446/rstudio-keyboard-shortcut-inline-code) – Samuel Allain May 09 '22 at 14:02