It would be nice to be able to have shortcuts for copy (keybinding: C), cut (keybinding: X) and paste (keybinding: V) of notebook cells when "outside" a cell, similar to the functionality of the original Jupyter notebook project.
Also I really miss the ability to split and merge cells with a simple keybinding.
Thanks for the suggestion. We haven't currently implemented cut/copy/paste/split or merge, but when we'll do we'll make sure to add the default keybindings.
Keyboard shortcuts need to work too as specified in the original repro.
@rchiodo the shortcuts A, B, DD work but C, X, F do not.
Hi!
The default keybindings contain
[{
"key": "cmd+c",
"command": "notebook.cell.copy",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "cmd+x",
"command": "notebook.cell.cut",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "ctrl+enter",
"command": "notebook.cell.execute",
"when": "notebookEditorFocused"
},
{
"key": "alt+enter",
"command": "notebook.cell.executeAndInsertBelow",
"when": "notebookEditorFocused"
},
{
"key": "shift+enter",
"command": "notebook.cell.executeAndSelectBelow",
"when": "notebookEditorFocused"
},
{
"key": "cmd+v",
"command": "notebook.cell.paste",
"when": "notebookEditorFocused && !inputFocus"
}
]
but they do all not work.
I wanted to put adapted versions (not cmd+c but just C etc.) into my user keybindings.json but that is also not working.
Is this work in progress and we just have the JSON definitions but no functionality for now?
Thanks!
Jamil
Unfortunately those default keybindings do not apply to the currently shipping product. They apply to something that's still in progress:
https://github.com/microsoft/vscode-python/issues/10496
The root cause of the key binding problem is that we had written our own custom notebook editor. It did not pass along the key bindings from VS code.
The work item I mention above (where the keybindings you're seeing are from) is to change our notebook editor to something that VS code provides. Once that work is complete all key bindings should work.
Great, thanks for this quick response! Can't await it :-)
Keep on the great work!
The shortcuts C, V, X, A, B, F, D D, M, Y etc. are all supported on the new VSC notebooks.
Does not work (e. g. "c" to copy or "x" to cut do not work) for me with
Visual Studio Code
Version: 1.48.1
Commit: 3dd905126b34dcd4de81fa624eb3a8cbe7485f13
Date: 2020-08-19T17:09:41.484Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0
and
Python extension in v2020.8.103604
having Jupyter running with Python 3.7.7
Thank you for writing back @jamilraichouni and @Econ808. I could've been more clear. These keyboard shortcuts are all supported in the new native notebooks (see: https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/). That link shows how to use them. Since that new notebook API will eventually become our default we are focusing on it.
Please try it out!
Very cool! I have actually turned to .py script + interactive window for almost all work, but this might actually bring me back to using .ipynb again 馃榾
Most helpful comment
Does not work (e. g. "c" to copy or "x" to cut do not work) for me with
Visual Studio Code
Version: 1.48.1
Commit: 3dd905126b34dcd4de81fa624eb3a8cbe7485f13
Date: 2020-08-19T17:09:41.484Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0
and
Python extension in v2020.8.103604
having Jupyter running with Python 3.7.7