Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

%>% key binding / keyboard shortcut in Rstudio

I've been experimenting quite a bit with the increasingly popular %>% operator from the magrittr package.

I've used it enough that I've set a keyboard shortcut to save me typing:

shift+command+. instead of space, shift+5, shift+., shift+5, space.

snapshot

This is great in SublimeTetxt2 but Rstudio does not allow services it does not work if I'm working within Rstudio projects.

So my question is:

Can you define text-inserting key-bindings or shortcuts within Rstudio?

This would be exactly synonymous with the alt+- binding for the assignment <- operator that is oxygen to the otter.

If someone could point me to where the shortcuts are coded in the github repo so I could "hack" my own, I suppose this would be a useful start.

https://github.com/rstudio/rstudio

like image 923
npjc Avatar asked May 29 '14 05:05

npjc


People also ask

What does Ctrl L do in R?

The shortest and the quickest way to clear the global environment in R is by using shortcut keys from the keyboards. Simply hit Ctrl+L on the keyboard and you will see that everything written in the console will be erased and the console will be cleared.

What is the shortcut key of R?

Ctrl+R in Excel and other spreadsheet programs To fill more than one cell, select the source cell and press Ctrl + Shift + Right arrow to select additional ones. Then, press Ctrl + R to fill them with the contents of the original cell. Using the Ctrl + D shortcut fills a column instead of a row.

How do I change keyboard shortcuts in RStudio?

You can modify a command's shortcut by clicking on the cell containing the current shortcut key sequence, and typing the new sequence you'd like to bind the command to.


1 Answers

Just noticed that RStudio v0.98.1079 has shift+command+M mapped for the %>% operator. You can check out the other keyboard shortcuts within RStudio by clicking at the Help tab or by entering alt+shift+K.

like image 130
Peter Diakumis Avatar answered Sep 28 '22 04:09

Peter Diakumis