Hello, happy new year!
I have these code from an LLM:
R
```
I want to turn it into
```{r}
I tried Find R\n\s``` and replace ```{r}, it works in Zed, but it does not in RStudio.
What is the acceptable syntax?
Thank you!
Hello, happy new year!
I have these code from an LLM:
R
```
I want to turn it into
```{r}
I tried Find R\n\s``` and replace ```{r}, it works in Zed, but it does not in RStudio.
What is the acceptable syntax?
Thank you!
AFAIK you cannot do this with the search and replace function in the RStudio editor, (it does work in Positron) but you could use a regex to replace text in the c/p buffer with
clipr::write_clip(
gsub(
"R\n```",
"```{r}",
paste(
clipr::read_clip(),
collapse = "\n")
)
)