搬运自
How to: Get Sublime Text style editing in the IPython/Jupyter notebook —— by PyBloggers/Robin'sBlog
- 定位到 Jupyter configuration 文件夹,终端输入
jupyter --config-dir
- 在名为
custom
的子文件夹中打开custom.js
- 在文件中添加以下代码,保存即可
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"],
function(sublime_keymap, cell, IPython) {
// setTimeout(function(){ // uncomment line to fake race-condition
cell.Cell.options_default.cm_config.keyMap = 'sublime';
var cells = IPython.notebook.get_cells();
for(var c=0; c< cells.length ; c++){
cells.code_mirror.setOption('keyMap', 'sublime');
}
// }, 1000)// uncomment line to fake race condition
}
);