any Hotkey for "Execute Current Selection in Appropriate Console" for Python And R

Hi

I use Python and R in pycharm. With the new R language support this is almost perfect

https://www.jetbrains.com/help/pycharm/r-plugin-support.html 

However, the hotkey for "Executing the current selection" is console specific, meaning that
i can assign for example  Ctrl + R for "execute the current selection in python
and assign Ctrl + Enter for "execute the current selection in R "

But I can't have a single key do both specific to the code snippet I would like to run. 

Does such a hotkey exist, that im not thinking of?
that would "Execute Current Selection in Appropriate Console"?, I.e figure out whether the 
code snippet is R or Python and then run it in the appropriate console?.

Thanks

0
3 comments

Hi, 

As far as I can tell (and have tested), you can assign one shortcut to both actions in keymap settings, and the appropriate action would be used depending on the context.

Action for python is called "Execute Selection in Python Console"

Action for R is called "Run selection"

0

Ah ok, I see.  I just have to assign the same hotkeys to to different command and not remove when prompted.
Thanks!

0

If you want to make a macro for selecting something and running it you will need to have:

the action for python is called "Execute Selection in Python Console"

and Action for R is called "Run selection"

assigned to different hotkeys, because executing in selection in python console will be classified as a macro  assigned to that step in the macro and will not work for the action in R run in selection.


0

Please sign in to leave a comment.