jupyterlab-vim icon indicating copy to clipboard operation
jupyterlab-vim copied to clipboard

change cell type shortcuts

Open jwkvam opened this issue 6 years ago • 6 comments

I found myself missing cell type shortcuts. I think in jupyter-vim-binding the shortcuts were cmdctrl-{1,2,3} to switch to code, markdown and raw cells. Do people like those shortcuts? Or would people like something more mnemonical: e.g. we could make it ctrl-o m for markdown, ctrl-o c for code and ctrl-o r for raw. Any thoughts or concerns? I was trying to think if those shortcuts may be better used for something else.

jwkvam avatar Feb 11 '18 23:02 jwkvam

I would like to use them, but they do not work for me. I'm in macos Safari. These shortcuts collide with Safari shortcuts. I have changed the Safari shortcuts (Show/Hide Bookmarks/Reading List Sidebar) but still they do not work. They also do not work on Chrome and Firefox on macOS. Am I doing something wrong? Yes: on Macos the shortcut keys are Cmd {1,2,3}, without the Ctrl. In the source code I see 'Accel', and apparently, this is just Cmd on a mac. Now the shortcuts work on Chrome. Still not in Safari, because they collide with unremappable shortcuts for showing tab 1, tab2, etc. So, yes, I'm in favour of different shortcuts. Would be nice to be able to customize them.

dirkroorda avatar Mar 14 '18 10:03 dirkroorda

Thanks for your feedback, I mostly use chrome so I didn't notice this. I'll implement the additional shortcuts above. In the meantime you can add them yourself in the advanced settings I believe.

jwkvam avatar Mar 14 '18 17:03 jwkvam

I did!

dirkroorda avatar Mar 18 '18 20:03 dirkroorda

CTRL-{1,2,3} is working for me by default on Firefox. I like them because they're fast and the Jupyter default. I'd prefer not to invent many new keybindings to minimize the learning curve. Jupyter and vim have many already. :)

mdeff avatar Mar 26 '18 09:03 mdeff

Same issue on Safari. Here are my User Overrides mapping cell types to Alt 1, Alt 2, Alt 3 in Advanced Settings Editor:

{    
    "notebook:change-cell-to-code": {
      "command": "notebook:change-cell-to-code",
      "keys": [
        "Alt 1"
      ],
      "selector": ".jp-Notebook.jp-mod-editMode"
    },
    
    "notebook:change-cell-to-markdown": {
      "command": "notebook:change-cell-to-markdown",
      "keys": [
        "Alt 2"
      ],
      "selector": ".jp-Notebook.jp-mod-editMode"
    },

    "notebook:change-cell-to-raw": {
      "command": "notebook:change-cell-to-raw",
      "keys": [
        "Alt 3"
      ],
      "selector": ".jp-Notebook.jp-mod-editMode"
    }
}

evdoks avatar Sep 21 '18 09:09 evdoks

This is annoying. Shall we disable it by default?

wookayin avatar Jan 24 '20 05:01 wookayin