addinexamples icon indicating copy to clipboard operation
addinexamples copied to clipboard

deprecated insertAtAddin function in addinexamples?

Open moldach opened this issue 7 years ago • 1 comments

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

moldach avatar Aug 08 '18 18:08 moldach

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?

IsadoraBM avatar May 04 '20 18:05 IsadoraBM