Skip navigation

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

  1. 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

  1. By Pipes (%>%) Everywhere – sec.uno on 22 Dec 2016 at 7:16 pm

    […] 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 → […]

  2. By Pipes (%>%) Everywhere - Use-R!Use-R! on 22 Dec 2016 at 9:16 pm

    […] 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 […]

  3. By Pipes (%>%) Everywhere – Mubashir Qasim on 22 Dec 2016 at 10:23 pm

    […] article was first published on R – rud.is, and kindly contributed to […]

  4. By Pipes (%>%) Everywhere – Cyber Security on 22 Dec 2016 at 10:56 pm

    […] 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 Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.