티스토리 뷰

mode

참고링크: http://www.perfectlyrandom.org/2016/03/19/sublime-text-style-multiple-cursors-in-jupyter-notebook/
https://github.com/jupyter/notebook/issues/278

  1. Python을 실행시켜서 Jupyter 설정 폴더 찾기

from jupyter_core.paths import jupyter_config_dir
 
jupyter_dir = jupyter_config_dir()
print(jupyter_dir)                     # Jupyter 설정 디렉토리 경로 
  1. 출력된 jupyter_dir 경로로 이동.

  2. custom 이란 디렉토리 생성.
    $ mkdir custom

  3. $ cd custom으로 custom디렉토리 내로 이동. 그리고 custom.js 란 파일 생성

  4. 아래의 구문 삽입

require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"],
    function(sublime_keymap, cell, IPython) {
        cell.Cell.options_default.cm_config.keyMap = 'sublime';
        var cells = IPython.notebook.get_cells();
        for(var c=0; c< cells.length ; c++){
            cells[c].code_mirror.setOption('keyMap', 'sublime');
        }
    } 
);
  1. jupyter notebook 실행 후, ctrl+d 를 눌렀을 때 같은 단어를 자동으로 선택해주는 기능이 실행되는지 확인.