holgerbrandl / r4intellij

An integration of the R programming language into Intellij IDEA
BSD 2-Clause "Simplified" License
148 stars 28 forks source link

Question: How to keystroke <- and %>% ? #181

Closed ekoepplin closed 6 years ago

ekoepplin commented 6 years ago

hi @holgerbrandl thank you for providing that integration with pycharm/intellij and R. I have a quite basic question I could not find any reference. Without assigning or redefining the current key bindings, is there anything similar to alt and - to get the assignment operator <-? Similarly, how would you keystroke the pipe - operator %>% (mac)?

holgerbrandl commented 6 years ago

You could just use a livetemplate. The plugin is declaring a few automatically, and maybe we could add <- and %>% as well (via PR if possible, since I don't have much time at the moment). See https://github.com/holgerbrandl/r4intellij/blob/master/resources/liveTemplates/rtemplates.xml

Btw most R folks seem to consider = to be preferrable to <- these days. See https://stackoverflow.com/a/1742591/590437

jewellsean commented 6 years ago

You could also record a macro and assign to keystrokes. Edit -> Macros -> Start Recording Macro following by Stop To assign keystroke Preferences -> Keymap -> Macros

ekoepplin commented 6 years ago

@holgerbrandl @jewellsean thank you! I think about adding that via PR in future.