rstudio / addinexamples

An R package showcasing how RStudio addins can be registered and used.
Other
86 stars 69 forks source link

deprecated insertAtAddin function in addinexamples? #10

Open moldach opened 6 years ago

moldach commented 6 years ago

In the past I could add my own shortcuts with the addinexamples package by doing the following; however, I'm getting an error now at the last step:

install.packages("rstudioapi", type = "source")
devtools::install_github("rstudio/addinexamples", type = "source")
library(rstudioapi)
library(addinexamples)

Now search for the addins.dcf file in your R directory and open it in a text editor.

Copy the first block to the bottom but replace %in% with %>% and the binding to insertAtAddin

Next quit R and then reload, now type:

insertAtAddin <- function(){rstudioapi::insertText(" %>% ")}

Now go to Addins on the toolbar and click Browser Addins then to shortcuts, now double-click function then type:

Shift + Ctrl + S

However, I'm not seeing the "Browser Addins' anymore on the Addins toolbar and when I try to click "Insert %>%I get an error saying that there is no functioninsertAtAddinin theaddinexamples` package.

Am I doing something wrong or has that function been removed? It was really helpful to set a two-stroke hotkey for the pipe operator (and many others!) rather than using Shift + Ctrl + M

IsadoraBM commented 4 years ago

Related:

I've tried adding a insertCompoundAddin function and binding it but I can't find the insertInAddin.R file, so I cannot add or duplicate and modify the file to add the following function

insertCompoundAddin <- function() { rstudioapi::insertText(" %<>% ") }

Is it possible for you to add it to the list?