Created
January 11, 2014 18:56
-
-
Save patricksnape/8375168 to your computer and use it in GitHub Desktop.
IPython restart and run all above shortcuts
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
%%javascript | |
IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { | |
if (IPython.notebook.mode == 'command') { | |
var selected_cell = IPython.notebook.get_selected_index(); | |
IPython.notebook.session.restart_kernel(); | |
$([IPython.events]).on('status_started.Kernel', function(){ | |
IPython.notebook.execute_cells_above(); | |
}); | |
return false; | |
} | |
return true; | |
}); | |
IPython.keyboard_manager.command_shortcuts.add_shortcut('q', function (event) { | |
if (IPython.notebook.mode == 'command') { | |
IPython.notebook.clear_all_output(); | |
return false; | |
} | |
return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment