Spyder: Don't hard code the Ctrl+Enter shortcut

Created on 2 Sep 2016  路  5Comments  路  Source: spyder-ide/spyder

ctrl + enter is hard coded? Why not allow it to be bound to other things if it is not a cell. Seems to me this would make ctrl+enter more consistent, no? Like this:

  • highest priority: if selection, then execute selection
  • mid priority: if no selection, execute cell around cursor
  • low priority: if no selection and no cell, execute line.

This issue is the result of this discussion: https://github.com/spyder-ide/spyder/issues/1670#issuecomment-237557798

Editor Completed Enhancement

Most helpful comment

The issue makes sense for people that want to preserve their muscle memory in RStudio and Spyder because in the first one is used to execute lines.

@goanpeca, @Nodd, @jitseniesen, what do you think?

All 5 comments

The issue makes sense for people that want to preserve their muscle memory in RStudio and Spyder because in the first one is used to execute lines.

@goanpeca, @Nodd, @jitseniesen, what do you think?

If I understand https://support.rstudio.com/hc/en-us/articles/200711853-Keyboard-Shortcuts correctly, in RStudio Ctrl+Enter runs selection or current line (like F9 in Spyder) and Ctrl+Alt+T runs the current "code section" (which I guess is equivalent to Ctrl+Enter in Spyder). So, for helping RStudio users it is enough to allow users to change the Ctrl+Enter short cut. I would agree with that.

Additionally, it is proposed that the "run cell" action bound to Ctrl+Enter is changed to "run selection or cell or line". I am more hesitant about this; maybe it's good to have one shortcut that automagically runs what needs to be run, but it may also be too magical and thus confusing. Imagine a menu item saying "run selection or cell or line". Is this what RStudio does? The link above suggests not.

It seems the best solution to support RStudio users for good is to create an _RStudio shortcuts_ profile in our Preferences, as we plan to do for Emacs users too in 3.1.

Once we complete the work started in PR #2670, it will be just a matter of adding the table of shortcuts @jitseniesen posted to our config system :-)

I am able to change F9 to Cmd+Enter in Keyboard Shortcuts in Preferences and it is working fine. So isn't the problem solved?

No, it's not. Ctrl+Enter it's still hard coded in our interface :-)

Was this page helpful?
0 / 5 - 0 ratings