Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom scripts for supporting sublime keymap
// .jupyter/custom/custom.js
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"],
function(sublime_keymap, cell, IPython) {
cell.Cell.options_default.cm_config.keyMap = 'sublime';
cell.Cell.options_default.cm_config.extraKeys['Ctrl-Enter'] = function() { console.log('ctrl-enter') };
var cells = IPython.notebook.get_cells();
for (var cl = 0; cl < cells.length; cl++) {
cells[cl].code_mirror.setOption('extraKeys', {
'Ctrl-Enter': function () {}
})
cells[cl].code_mirror.setOption('keyMap', 'sublime');
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.