gadenbuie / shrtcts

Make Anything an RStudio Shortcut
https://pkg.garrickadenbuie.com/shrtcts/
Other
119 stars 4 forks source link

Error in shortcut() : argument "lhs" is missing, with no default #13

Closed ries9112 closed 3 years ago

ries9112 commented 3 years ago

Thank you for making this package!

The provided example works great, and I was able to get it to work without issues: image

I am trying to add a new keyboard shortcut for the magrittr operator %<>%, but I am running into the following error after properly configuring the shortcut like I did for the example: image

Here is a screenshot of my .shrtcts.R file: image

Is there a way for me to setup a shortcut for this pipe operator?

I am on the new MacBook Air with the M1 chip

``` > Sys.info() sysname "Darwin" release "20.2.0" version "Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101" nodename "riccardos-air.lan" machine "x86_64" login "root" user "riccardoesclapon" effective_user "riccardoesclapon" ``` Happy to provide any other information that might help here. Thanks again!
gadenbuie commented 3 years ago

Unfortunately, shrtcts isn't really great for what you're wanting to do here. Instead if inserting the text or function with the pipe operator, each shortcut is intended to be a function that's run by shrtcts. So you would need a function that, when run, inserts the pipe operator into your code.

It's possible to make that work, but there's another RStudio feature that will probably be a better fit: code snippets.

Hope that helps!