when I press ctrl+shift+m I get magrittr pipe %>% I want to setup promise pipe on some shortcut like ctrl+shift+p or something. How can I do it??
It is a shortcut setting process.
- open your RStudio
- click Tools -> Keyboard Shortcuts
- type the key value: pipe, you will find the shortcut named by
Insert Pipe Operator
- set the shortcut you want
Thanks for replying but that shortcut is default for magrittr pipes. I mean insert pipe operator actually inserts magrittr pipe like
what i want to insert is promise package pipe
Hope you get the difference.
The simplest option is to make a code snippet with a very short trigger. Pressing Shift+Tab after typing the entire trigger will immediately insert the snippet, and you can control the post-insert cursor position from the snippet definition.
To get a true keyboard shortcut (with command key modifiers) for an arbitrary snippet of text, you can make an RStudio Add-In, which can be assigned to keyboard shortcuts.
Inserting snippets via keyboard shortcut is one of the intended use cases for add-ins and there are already packages out there that include useful common bits of text, such as
remedy for inserting Markdown formatting. The
addinslist add-in can help you find more cool add-ins.
Maybe somebody else has already done an all-the-
magrittr-pipes add-in? If not, maybe you could contribute one!