Skip to content

Instantly share code, notes, and snippets.

@rightson
Created June 18, 2019 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightson/36beb699a5bc59a7d27d2cf32ec097cd to your computer and use it in GitHub Desktop.
Save rightson/36beb699a5bc59a7d27d2cf32ec097cd to your computer and use it in GitHub Desktop.
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