美文网首页
【HowTo系列】Jupyter 中的 Sublime Text

【HowTo系列】Jupyter 中的 Sublime Text

作者: 一筐荚果 | 来源:发表于2019-02-02 16:34 被阅读9次

搬运自

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

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 
    } 
);

相关文章

网友评论

      本文标题:【HowTo系列】Jupyter 中的 Sublime Text

      本文链接:https://www.haomeiwen.com/subject/bgtcdqtx.html