缩进快捷键

This commit is contained in:
Liang Ding 2014-09-03 00:05:05 +08:00
parent 8d6d306959
commit 77afacc3b1
2 changed files with 52 additions and 45 deletions

View File

@ -9,11 +9,13 @@
<h1>键盘快捷键</h1> <h1>键盘快捷键</h1>
<ul> <ul>
<li>F11: 编辑器全屏</li>
<li>Ctrl+G: 跳转到行</li> <li>Ctrl+G: 跳转到行</li>
<li>Ctrl+\\: 自动补全</li> <li>Ctrl+\\: 自动补全</li>
<li>Ctrl+D: 删除当前行</li> <li>Ctrl+E: 删除当前行</li>
<li>F11: 编辑器全屏</li>
<li>Shift+Tab: 自动缩进</li> <li>Shift+Tab: 自动缩进</li>
<li>Ctrl+]: 缩进</li>
<li>Ctrl+[: 反缩进</li>
</ul> </ul>
</body> </body>
</html> </html>

View File

@ -147,6 +147,9 @@ var editors = {
cm.setCursor(CodeMirror.Pos(line - 1, 0)); cm.setCursor(CodeMirror.Pos(line - 1, 0));
}; };
CodeMirror.commands.doNothing = function(cm) {
};
}, },
newEditor: function(data) { newEditor: function(data) {
$(".ico-fullscreen").show(); $(".ico-fullscreen").show();
@ -186,7 +189,9 @@ var editors = {
"'{'": "autocompleteRightPart", "'{'": "autocompleteRightPart",
"'\"'": "autocompleteRightPart", "'\"'": "autocompleteRightPart",
"'''": "autocompleteRightPart", "'''": "autocompleteRightPart",
"Ctrl-G": "gotoLine" "Ctrl-G": "gotoLine",
"Ctrl-E": "deleteLine",
"Ctrl-D": "doNothing" // 取消默认的 deleteLine
} }
}); });
editor.setSize('100%', $(".edit-panel").height() - $(".edit-header").height()); editor.setSize('100%', $(".edit-panel").height() - $(".edit-header").height());