I set some user shortcuts in the VSCode,but when I coding with notebook I found the shortcuts did not work. How to user my own keyboard shortcuts when coding with notebook ?
And, I set '"editor.mouseWheelZoom": true' in 'setting.json',it also doesn't work. How should I do?
Sorry but most of the custom editor settings do not apply yet to the Jupyter notebook editors.
They aren't being hosted inside of VS code, but inside of a separate process that uses an editor that looks a lot like VS code's. We need to port all of the functionality for VS code over to this new editor before it will work there as well.
Can you list out all of your editor customization settings? This way we can prioritize ones that people are using.
@rchiodo Hi, same for me... My key bindings alow me to almost never touch my mouse nor the arrow keys (basically, I avoid everything which makes me move my hands ...).
Thus, not having my keybindings available into jupyter is a bit frustrating. That would be supercool if they can be seemlesly integrated.
My keybindings.json file: https://pastebin.com/s8RkafPp
ctrl+b for hiding sidebar not working inside notebook.
Sorry but most of the VS code shortcuts are not supported.
We hope to either reimplement all keyboard shortcuts (where possible) or possibly VS code will take ownership of rendering notebooks themselves (wherein a notebook would be just like any other document).
That's unfortunate. I think VSCode + notebook + shortcuts would be a supreme tool for fast data-science-y projects dev speed.
Related: https://github.com/microsoft/vscode/issues/82495 (adding here because I found that issue first and had to do more detailed searching to get to this one)
Would love to just be able to Cmd+A to Select All in a cell. Also Cmd+Shift+Arrow to select everything before or after cursor. Those ones are huge for me personally.
ctrl+bfor hiding sidebar not working inside notebook.
It works in edit mode for me.
Sorry but most of the custom editor settings do not apply yet to the Jupyter notebook editors.
They aren't being hosted inside of VS code, but inside of a separate process that uses an editor that looks a lot like VS code's. We need to port all of the functionality for VS code over to this new editor before it will work there as well.
Can you list out all of your editor customization settings? This way we can prioritize ones that people are using.
I have all my Jupyter notebook keybindings in the following file ${JUPYTER_CONFIG_DIR}/custom/custom.js and it looks like listed below.
// CodeMirror API - https://codemirror.net/doc/manual.html#api
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace", "codemirror/lib/codemirror"],
function(sublime_keymap, cell, IPython, CodeMirror) {
cell.Cell.options_default.cm_config.keyMap = 'sublime';
cell.Cell.options_default.cm_config.extraKeys["Cmd-Enter"] = function(cm) {}
cell.Cell.options_default.cm_config.extraKeys["Cmd-7"] = function (cm) {
// Delete the part of the line before the cursor.
CodeMirror.commands.toggleComment(cm);
};
cell.Cell.options_default.cm_config.extraKeys["Cmd-F7"] = function (cm) {
// Delete the part of the line before the cursor.
CodeMirror.commands.delLineLeft(cm);
};
cell.Cell.options_default.cm_config.extraKeys["Cmd-F8"] = function (cm) {
// Delete the whole line under the cursor, including newline at the end.
CodeMirror.commands.deleteLine(cm);
};
cell.Cell.options_default.cm_config.extraKeys["Cmd-F9"] = function (cm) {
// Delete the part of the line after the cursor. If that consists only
// of whitespace, the newline at the end of the line is also deleted.
CodeMirror.commands.killLine(cm);
};
var cells = IPython.notebook.get_cells();
for(var cl=0; cl< cells.length ; cl++){
cells[cl].code_mirror.setOption('keyMap', 'sublime');
cells[cl].code_mirror.setOption("extraKeys", {
"Cmd-Enter": function(cm) {},
"Cmd-7": function(cm) {
// Delete the part of the line before the cursor.
CodeMirror.commands.toggleComment(cm);
},
"Cmd-F7": function(cm) {
// Delete the part of the line before the cursor.
CodeMirror.commands.delLineLeft(cm);
},
"Cmd-F8": function(cm) {
// Delete the whole line under the cursor, including newline at the end.
CodeMirror.commands.deleteLine(cm);
},
"Cmd-F9": function(cm) {
// Delete the part of the line after the cursor. If that consists only
// of whitespace, the newline at the end of the line is also deleted.
CodeMirror.commands.killLine(cm);
},
});
}
}
);
This separate process, is a Jupyter server in the end. Does VSCode also invoke CodeMirror? If so, something like that what I'm doing here might be possible.
Most helpful comment
That's unfortunate. I think VSCode + notebook + shortcuts would be a supreme tool for fast data-science-y projects dev speed.