Merge pull request #3673 from minrk/cm-comment

enable comment/uncomment selection in notebook

Bound to `(cmd|ctrl)-/`
This commit is contained in:
Matthias Bussonnier 2013-07-18 08:56:16 -07:00
commit ba24f709cb
2 changed files with 8 additions and 1 deletions

View File

@ -85,7 +85,13 @@ var IPython = (function (IPython) {
CodeCell.options_default = {
cm_config : {
extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess",'Backspace':"delSpaceToPrevTabStop"},
extraKeys: {
"Tab" : "indentMore",
"Shift-Tab" : "indentLess",
"Backspace" : "delSpaceToPrevTabStop",
"Cmd-/" : "toggleComment",
"Ctrl-/" : "toggleComment"
},
mode: 'ipython',
theme: 'ipython',
matchBrackets: true

View File

@ -211,6 +211,7 @@ class="notebook_app"
<script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script>
<script src="{{ static_url("components/codemirror/addon/mode/overlay.js") }}" charset="utf-8"></script>
<script src="{{ static_url("components/codemirror/addon/edit/matchbrackets.js") }}" charset="utf-8"></script>
<script src="{{ static_url("components/codemirror/addon/comment/comment.js") }}" charset="utf-8"></script>
<script src="{{ static_url("notebook/js/codemirror-ipython.js") }}" charset="utf-8"></script>
<script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script>
<script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script>