From 73e88b6677a4d73ac1b9a55721f22b30418f6268 Mon Sep 17 00:00:00 2001 From: damianavila Date: Sat, 6 Jul 2013 18:59:54 -0300 Subject: [PATCH 1/2] Added shorcuts to split cell, merge cell above and merge cell below. --- IPython/html/static/notebook/js/notebook.js | 15 +++++++++++++++ IPython/html/static/notebook/js/quickhelp.js | 3 +++ 2 files changed, 18 insertions(+) diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 0fe0df26a..a6de7d378 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -319,6 +319,21 @@ var IPython = (function (IPython) { that.undelete(); that.control_key_active = false; return false; + } else if (event.which === 55 && that.control_key_active) { + // Split cell = w + that.split_cell(); + that.control_key_active = false; + return false; + } else if (event.which === 56 && that.control_key_active) { + // Merge cell above = e + that.merge_cell_above(); + that.control_key_active = false; + return false; + } else if (event.which === 57 && that.control_key_active) { + // Merge cell below = r + that.merge_cell_below(); + that.control_key_active = false; + return false; } else if (that.control_key_active) { that.control_key_active = false; return true; diff --git a/IPython/html/static/notebook/js/quickhelp.js b/IPython/html/static/notebook/js/quickhelp.js index 568fa377b..bf32a093b 100644 --- a/IPython/html/static/notebook/js/quickhelp.js +++ b/IPython/html/static/notebook/js/quickhelp.js @@ -44,6 +44,9 @@ var IPython = (function (IPython) { {key: 'Ctrl-m m', help: 'markdown cell'}, {key: 'Ctrl-m t', help: 'raw cell'}, {key: 'Ctrl-m 1-6', help: 'heading 1-6 cell'}, + {key: 'Ctrl-m 7', help: 'split cell'}, + {key: 'Ctrl-m 8', help: 'merge cell above'}, + {key: 'Ctrl-m 9', help: 'merge cell below'}, {key: 'Ctrl-m p', help: 'select previous'}, {key: 'Ctrl-m n', help: 'select next'}, {key: 'Ctrl-m i', help: 'interrupt kernel'}, From 7aab2ec291a1a37c0ed09a026c9b3e2095e7830f Mon Sep 17 00:00:00 2001 From: damianavila Date: Tue, 9 Jul 2013 17:55:13 -0300 Subject: [PATCH 2/2] Added '-' as a shortcut for splitting cells. --- IPython/html/static/notebook/js/notebook.js | 16 +++------------- IPython/html/static/notebook/js/quickhelp.js | 4 +--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index a6de7d378..ec89cc288 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -319,21 +319,11 @@ var IPython = (function (IPython) { that.undelete(); that.control_key_active = false; return false; - } else if (event.which === 55 && that.control_key_active) { - // Split cell = w + } else if (event.which === 189 && that.control_key_active) { + // Split cell = - that.split_cell(); that.control_key_active = false; - return false; - } else if (event.which === 56 && that.control_key_active) { - // Merge cell above = e - that.merge_cell_above(); - that.control_key_active = false; - return false; - } else if (event.which === 57 && that.control_key_active) { - // Merge cell below = r - that.merge_cell_below(); - that.control_key_active = false; - return false; + return false; } else if (that.control_key_active) { that.control_key_active = false; return true; diff --git a/IPython/html/static/notebook/js/quickhelp.js b/IPython/html/static/notebook/js/quickhelp.js index bf32a093b..dc83a9e7c 100644 --- a/IPython/html/static/notebook/js/quickhelp.js +++ b/IPython/html/static/notebook/js/quickhelp.js @@ -32,6 +32,7 @@ var IPython = (function (IPython) { {key: 'Ctrl-m v', help: 'paste cell'}, {key: 'Ctrl-m d', help: 'delete cell'}, {key: 'Ctrl-m z', help: 'undo last cell deletion'}, + {key: 'Ctrl-m -', help: 'split cell'}, {key: 'Ctrl-m a', help: 'insert cell above'}, {key: 'Ctrl-m b', help: 'insert cell below'}, {key: 'Ctrl-m o', help: 'toggle output'}, @@ -44,9 +45,6 @@ var IPython = (function (IPython) { {key: 'Ctrl-m m', help: 'markdown cell'}, {key: 'Ctrl-m t', help: 'raw cell'}, {key: 'Ctrl-m 1-6', help: 'heading 1-6 cell'}, - {key: 'Ctrl-m 7', help: 'split cell'}, - {key: 'Ctrl-m 8', help: 'merge cell above'}, - {key: 'Ctrl-m 9', help: 'merge cell below'}, {key: 'Ctrl-m p', help: 'select previous'}, {key: 'Ctrl-m n', help: 'select next'}, {key: 'Ctrl-m i', help: 'interrupt kernel'},