From 1c8437a1231d86711d4cb2ad0070b24c8b556a26 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 15 Jan 2016 22:19:35 +0100 Subject: [PATCH] add ctrl-alt-[ shortcut for indentAuto and move common cell commands to Cell base config --- notebook/static/notebook/js/cell.js | 12 +++++++++--- notebook/static/notebook/js/codecell.js | 4 ---- notebook/static/notebook/js/textcell.js | 1 - 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/notebook/static/notebook/js/cell.js b/notebook/static/notebook/js/cell.js index 5eeb0b11e..78602d68c 100644 --- a/notebook/static/notebook/js/cell.js +++ b/notebook/static/notebook/js/cell.js @@ -114,9 +114,15 @@ define([ readOnly: false, theme: "default", extraKeys: { - "Cmd-Right":"goLineRight", - "End":"goLineRight", - "Cmd-Left":"goLineLeft" + "Cmd-Right": "goLineRight", + "End": "goLineRight", + "Cmd-Left": "goLineLeft", + "Tab": "indentMore", + "Shift-Tab" : "indentLess", + "Cmd-Alt-[" : "indentAuto", + "Ctrl-Alt-[" : "indentAuto", + "Cmd-/" : "toggleComment", + "Ctrl-/" : "toggleComment", } } }; diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 59807b0d8..10b361149 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -125,11 +125,7 @@ define([ CodeCell.options_default = { cm_config : { extraKeys: { - "Tab" : "indentMore", - "Shift-Tab" : "indentLess", "Backspace" : "delSpaceToPrevTabStop", - "Cmd-/" : "toggleComment", - "Ctrl-/" : "toggleComment" }, mode: 'text', theme: 'ipython', diff --git a/notebook/static/notebook/js/textcell.js b/notebook/static/notebook/js/textcell.js index d95563080..96c6db0c1 100644 --- a/notebook/static/notebook/js/textcell.js +++ b/notebook/static/notebook/js/textcell.js @@ -70,7 +70,6 @@ define([ TextCell.options_default = { cm_config : { - extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess"}, mode: 'htmlmixed', lineWrapping : true, }