Skip to content

Instantly share code, notes, and snippets.

@jdbrice
Created February 9, 2016 19:50
Show Gist options
  • Save jdbrice/e4bf8241371c0909f862 to your computer and use it in GitHub Desktop.
Save jdbrice/e4bf8241371c0909f862 to your computer and use it in GitHub Desktop.
Sublime Keymap for Jupyter Notebooks
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"],
function(sublime_keymap, cell, IPython) {
require("notebook/js/cell").Cell
setTimeout(function(){ // uncomment line to fake race-condition
require("notebook/js/cell").Cell.options_default.cm_config.keyMap = 'sublime';
var cells = IPython.notebook.get_cells();
for(var c=0; c<cells.length ; c++){
console.log( "Setting Sublime" )
cells[c].code_mirror.setOption('keyMap', 'sublime');
}
}, 1000)// uncomment line to fake race condition
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment