Is the backtick key, `, missing from your keyboard? Has it been mapped for use by other software? Scratch your backtick itch with {backtick}.
{backtick} is a very tiny R package containing functions that insert backticks into R scripts and R Markdown documents. It's intended for use as an RStudio Addin.
Install with:
install.packages("remotes") # if not yet installed
remotes::install_github("matt-dray/backtick")
On restart, the functions will be available to you from the RStudio Addins menu. You could also set them to keyboard shortcuts.
With these functions you can:
- insert a single backtick (
`
) - surround selected text with backticks (
selection
becomes`selection`
) - surround selected text with backticks for execution as inline R code in an R Markdown document (
selection
becomes`r selection`
) - surround selected text with backticks for execution as an R code chunk in an R Markdown document (
selection
is surrounded by```{r}
above and```
below)
This gif shows each one in action:
Leave an issue or provide a PR for suggestions or additions.