execute cell using Cmd Enter (Ctrl Enter on Windows)

513 views
Skip to first unread message

vnijs

unread,
Jun 20, 2018, 6:42:44 PM6/20/18
to Project Jupyter
Just started to use Jupyter lab. It is a great tool but the Shift Enter keyboard shortcut to execute code in a cell was unexpected. I'm so used to Cmd Enter (mac) or Ctrl Enter (windows) that I'd like to change this shortcut. This looks straight forward with "User overrides" but for some reason it doesn't take. See code I added: 

{
    "console:run-forced": {
      "command": "console:run-forced",
      "keys": [
        "Cmd Enter"
      ],
      "selector": ".jp-CodeConsole-promptCell"
    }
}

FYI I'm using Version 0.32.1 on Ubuntu 18.04

vnijs

unread,
Aug 3, 2018, 9:06:34 PM8/3/18
to Project Jupyter
The easiest way to do this seems to be the shortcut ui extension for Jupyter. See link below

Jason Grout

unread,
Aug 3, 2018, 11:51:11 PM8/3/18
to jup...@googlegroups.com
I would suggest using the Settings menu entry to change the console execute shortcut to enter, then modify the resulting customized shortcuts however you like.

Jason


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/8337d911-cb73-47cd-b463-0818560f8631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vnijs

unread,
Aug 4, 2018, 12:07:56 AM8/4/18
to Project Jupyter
That was my initial attempt actually, which was not successful. The shortcut ui extension changes the settings, as shown below, by adding Cmd Enter (or Accel Enter) as a extra short cut rather than replacing Shift Cmd which was nice

{
    // Keyboard Shortcuts
    // @jupyterlab/shortcuts-extension:plugin
    // Keyboard shortcut settings for JupyterLab.
    // ******************************************

    // [missing schema title]
    // [missing schema description]
    "console:run-forced-2": {
      "command": "console:run-forced",
      "keys": [
        "Accel Enter"
      ],
      "selector": ".jp-CodeConsole-promptCell",
      "title": "Run Cell (forced)",
      "category": "Console"
    },

    // [missing schema title]
    // [missing schema description]
    "notebook:run-cell-and-select-next-2": {
      "command": "notebook:run-cell-and-select-next",
      "keys": [
        "Accel Enter"
      ],
      "selector": ".jp-Notebook.jp-mod-editMode",
      "title": "Run Cell and Select Next",
      "category": "Notebook Operations"
Reply all
Reply to author
Forward
0 new messages