diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index 88bc6c832..bc0bb78d6 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/IPython/frontend/html/notebook/static/js/notebook.js @@ -114,6 +114,14 @@ var IPython = (function (IPython) { } else if (event.which === key.ENTER && event.shiftKey) { that.execute_selected_cell(); return false; + } else if (event.which === key.ENTER && event.altKey) { + // Execute code cell, and insert new in place + that.execute_selected_cell(); + // Only insert a new cell, if we ended up in an already populated cell + if (/\S/.test(that.get_selected_cell().get_text()) == true) { + that.insert_cell_above('code'); + } + return false; } else if (event.which === key.ENTER && event.ctrlKey) { that.execute_selected_cell({terminal:true}); return false; diff --git a/IPython/frontend/html/notebook/static/js/quickhelp.js b/IPython/frontend/html/notebook/static/js/quickhelp.js index d609e704b..e88df2f33 100644 --- a/IPython/frontend/html/notebook/static/js/quickhelp.js +++ b/IPython/frontend/html/notebook/static/js/quickhelp.js @@ -28,6 +28,7 @@ var IPython = (function (IPython) { var shortcuts = [ {key: 'Shift-Enter', help: 'run cell'}, {key: 'Ctrl-Enter', help: 'run cell in-place'}, + {key: 'Alt-Enter', help: 'run cell, insert below'}, {key: 'Ctrl-m x', help: 'cut cell'}, {key: 'Ctrl-m c', help: 'copy cell'}, {key: 'Ctrl-m v', help: 'paste cell'},