Created
June 18, 2019 11:57
-
-
Save rightson/36beb699a5bc59a7d27d2cf32ec097cd to your computer and use it in GitHub Desktop.
Custom scripts for supporting sublime keymap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .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