An R user asked a question regarding whether it’s possible to have the RStudio pipe (%>%
) shortcut (Cmd-Shift-M
) available in other macOS applications. If you’re using Alfred then you can use this workflow for said task (IIRC this requires an Alfred license which is reasonably cheap).
When you add it to Alfred you must edit it to make Cmd-Shift-M
the hotkey since Alfred strips the keys on import (for good reasons). I limited the workflow to a few apps (Safari, Chrome, Sublime Text, iTerm) and I think it makes sense to limit the apps it applies to (you don’t need the operator everywhere, at least IMO).
I can’t believe I didn’t do this earlier. I use R in the terminal a bit and mis-hit Cmd-Shift-M
all the time when I do (since RStudio is my primary editor for R code and muscle memory is scarily powerful). I also have to use (ugh) Jupyter notebooks on occasion and this will help there, too. If you end up modifying or using the workflow, drop a note in the comments.
One Comment
Was looking for a way to do this in Ubuntu and never found a happy solution. Also would like a -> key and a <- key. I’m thinking of just ordering a blank usb keypad on the side if I can find one that helps you set your own key meanings.
4 Trackbacks/Pingbacks
[…] An R user asked a question regarding whether it’s possible to have the RStudio pipe (%>%) shortcut (Cmd-Shift-M) available in other macOS applications. If you’re using Alfred then you can use this workflow for said task (IIRC this requires an Alfred license which is reasonably cheap). When you add it to Alfred you must edit… Continue reading → […]
[…] leave a comment for the author, please follow the link and comment on their blog: R – rud.is.R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data […]
[…] article was first published on R – rud.is, and kindly contributed to […]
[…] An R user asked a question regarding whether it’s possible to have the RStudio pipe (%>%) shortcut (Cmd-Shift-M) available in other macOS applications. If you’re using Alfred then you can use this workflow for said task (IIRC this requires an Alfred license which is reasonably cheap). When you add it to Alfred you must edit… Continue reading → […]