【HowTo系列】Jupyter 中的 Sublime Text 神操作

搬运自

How to: Get Sublime Text style editing in the IPython/Jupyter notebook —— by PyBloggers/Robin'sBlog

2648772-ac4c2cdc30c5d38b.gif
image
  1. 定位到 Jupyter configuration 文件夹,终端输入jupyter --config-dir
  2. 在名为custom 的子文件夹中打开custom.js
  3. 在文件中添加以下代码,保存即可
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 
    } 
);

猜你喜欢

转载自blog.csdn.net/weixin_34112900/article/details/87027124