shrtcts
shrtcts copied to clipboard
Add helper for inserting text
In cases where the goal of the shortcut is to add an option to insert text. This is possible with a wrapper around rstudioapi functions, but requires a bit of boilerplate.
#' Insert New Pipe
shrtcts::insert_text(" |> ", where = "activeDocument")
https://rstudio.github.io/rstudioapi/reference/rstudio-editors.html
Would also be nice to check (or add option to check) for spaces around the text, e.g. to add whitespace before and after if not already present.