Pipes (%>%) Everywhere

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.

Cover image from Data-Driven Security
Amazon Author Page

5 Comments Pipes (%>%) Everywhere

  1. Pingback: Pipes (%>%) Everywhere – sec.uno

  2. Pingback: Pipes (%>%) Everywhere - Use-R!Use-R!

  3. Pingback: Pipes (%>%) Everywhere – Mubashir Qasim

  4. Pingback: Pipes (%>%) Everywhere – Cyber Security

  5. isomorphismes

    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.

    Reply

Leave a Reply

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