Last active
September 16, 2016 19:47
-
-
Save hosamshahin/589faf7509a6e9cec8614913841e4558 to your computer and use it in GitHub Desktop.
This file contains 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
-- http://blog.rtwilson.com/how-to-get-sublime-text-style-editing-in-the-ipythonjupyter-notebook/ | |
Anaconda 3.5 | |
custom.js file path | |
/home/hshahin/anaconda3/lib/python3.5/site-packages/notebook/static/custom/custom.js | |
So, how do you do this? It’s really simple. | |
Find your Jupyter configuration folder by running jupyter --config-dir | |
Open the custom.js file in the custom sub-folder in your favourite editor | |
Add the following lines to the bottom of the file | |
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 cl=0; cl< cells.length ; cl++){ | |
cells[cl].code_mirror.setOption('keyMap', 'sublime'); | |
} | |
// }, 1000)// uncomment line to fake race condition | |
} | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment