Skip to content

Instantly share code, notes, and snippets.

@hosamshahin
Last active September 16, 2016 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosamshahin/589faf7509a6e9cec8614913841e4558 to your computer and use it in GitHub Desktop.
Save hosamshahin/589faf7509a6e9cec8614913841e4558 to your computer and use it in GitHub Desktop.
-- 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