jupyterlab-vim
jupyterlab-vim copied to clipboard
change cell type shortcuts
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.
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.
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.
I did!
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. :)
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"
}
}
This is annoying. Shall we disable it by default?