Skip to content

Instantly share code, notes, and snippets.

@WaylonWalker
Created July 27, 2017 03:29
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 WaylonWalker/666c1300f63abb52ef6ba95c180aca45 to your computer and use it in GitHub Desktop.
Save WaylonWalker/666c1300f63abb52ef6ba95c180aca45 to your computer and use it in GitHub Desktop.
//add to ~.jupyter/custom/custom.js
//full list of key bindings here --> https://codemirror.net/demo/sublime.html
//reference --> https://stackoverflow.com/questions/36384921/disable-ctrlenter-sublime-keymap-in-jupyter-notebook
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(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", {
"Ctrl-Enter": function(cm) {}
});
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment