Merge pull request #788 from nightwing/keybindings

improve default keybindings
This commit is contained in:
Ruben Daniels 2012-06-08 14:07:40 -07:00
commit 62c0e594f4

View file

@ -72,22 +72,22 @@ exports.commands = [{
readOnly: true readOnly: true
}, { }, {
name: "fold", name: "fold",
bindKey: bindKey("Alt-L", "Alt-L"), bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
exec: function(editor) { editor.session.toggleFold(false); }, exec: function(editor) { editor.session.toggleFold(false); },
readOnly: true readOnly: true
}, { }, {
name: "unfold", name: "unfold",
bindKey: bindKey("Alt-Shift-L", "Alt-Shift-L"), bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
exec: function(editor) { editor.session.toggleFold(true); }, exec: function(editor) { editor.session.toggleFold(true); },
readOnly: true readOnly: true
}, { }, {
name: "foldall", name: "foldall",
bindKey: bindKey("Alt-0", "Alt-0"), bindKey: bindKey("Alt-0", "Command-Option-0"),
exec: function(editor) { editor.session.foldAll(); }, exec: function(editor) { editor.session.foldAll(); },
readOnly: true readOnly: true
}, { }, {
name: "unfoldall", name: "unfoldall",
bindKey: bindKey("Alt-Shift-0", "Alt-Shift-0"), bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"),
exec: function(editor) { editor.session.unfold(); }, exec: function(editor) { editor.session.unfold(); },
readOnly: true readOnly: true
}, { }, {
@ -110,17 +110,17 @@ exports.commands = [{
readOnly: true readOnly: true
}, { }, {
name: "overwrite", name: "overwrite",
bindKey: bindKey("Insert", "Insert"), bindKey: "Insert",
exec: function(editor) { editor.toggleOverwrite(); }, exec: function(editor) { editor.toggleOverwrite(); },
readOnly: true readOnly: true
}, { }, {
name: "selecttostart", name: "selecttostart",
bindKey: bindKey("Ctrl-Shift-Home|Alt-Shift-Up", "Command-Shift-Up"), bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"),
exec: function(editor) { editor.getSelection().selectFileStart(); }, exec: function(editor) { editor.getSelection().selectFileStart(); },
readOnly: true readOnly: true
}, { }, {
name: "gotostart", name: "gotostart",
bindKey: bindKey("Ctrl-Home|Ctrl-Up", "Command-Home|Command-Up"), bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
exec: function(editor) { editor.navigateFileStart(); }, exec: function(editor) { editor.navigateFileStart(); },
readOnly: true readOnly: true
}, { }, {
@ -137,13 +137,13 @@ exports.commands = [{
readOnly: true readOnly: true
}, { }, {
name: "selecttoend", name: "selecttoend",
bindKey: bindKey("Ctrl-Shift-End|Alt-Shift-Down", "Command-Shift-Down"), bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"),
exec: function(editor) { editor.getSelection().selectFileEnd(); }, exec: function(editor) { editor.getSelection().selectFileEnd(); },
multiSelectAction: "forEach", multiSelectAction: "forEach",
readOnly: true readOnly: true
}, { }, {
name: "gotoend", name: "gotoend",
bindKey: bindKey("Ctrl-End|Ctrl-Down", "Command-End|Command-Down"), bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
exec: function(editor) { editor.navigateFileEnd(); }, exec: function(editor) { editor.navigateFileEnd(); },
multiSelectAction: "forEach", multiSelectAction: "forEach",
readOnly: true readOnly: true
@ -233,43 +233,53 @@ exports.commands = [{
readOnly: true readOnly: true
}, { }, {
name: "selectpagedown", name: "selectpagedown",
bindKey: bindKey("Shift-PageDown", "Shift-PageDown"), bindKey: "Shift-PageDown",
exec: function(editor) { editor.selectPageDown(); }, exec: function(editor) { editor.selectPageDown(); },
readOnly: true readOnly: true
}, { }, {
name: "pagedown", name: "pagedown",
bindKey: bindKey(null, "PageDown"), bindKey: bindKey(null, "Option-PageDown"),
exec: function(editor) { editor.scrollPageDown(); }, exec: function(editor) { editor.scrollPageDown(); },
readOnly: true readOnly: true
}, { }, {
name: "gotopagedown", name: "gotopagedown",
bindKey: bindKey("PageDown", "Option-PageDown|Ctrl-V"), bindKey: bindKey("PageDown", "PageDown|Ctrl-V"),
exec: function(editor) { editor.gotoPageDown(); }, exec: function(editor) { editor.gotoPageDown(); },
readOnly: true readOnly: true
}, { }, {
name: "selectpageup", name: "selectpageup",
bindKey: bindKey("Shift-PageUp", "Shift-PageUp"), bindKey: "Shift-PageUp",
exec: function(editor) { editor.selectPageUp(); }, exec: function(editor) { editor.selectPageUp(); },
readOnly: true readOnly: true
}, { }, {
name: "pageup", name: "pageup",
bindKey: bindKey(null, "PageUp"), bindKey: bindKey(null, "Option-PageUp"),
exec: function(editor) { editor.scrollPageUp(); }, exec: function(editor) { editor.scrollPageUp(); },
readOnly: true readOnly: true
}, { }, {
name: "gotopageup", name: "gotopageup",
bindKey: bindKey("PageUp", "Option-PageUp"), bindKey: "PageUp",
exec: function(editor) { editor.gotoPageUp(); }, exec: function(editor) { editor.gotoPageUp(); },
readOnly: true readOnly: true
}, {
name: "scrollup",
bindKey: bindKey("Ctrl-Up", null),
exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },
readOnly: true
}, {
name: "scrolldown",
bindKey: bindKey("Ctrl-Down", null),
exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },
readOnly: true
}, { }, {
name: "selectlinestart", name: "selectlinestart",
bindKey: bindKey("Shift-Home", "Shift-Home"), bindKey: "Shift-Home",
exec: function(editor) { editor.getSelection().selectLineStart(); }, exec: function(editor) { editor.getSelection().selectLineStart(); },
multiSelectAction: "forEach", multiSelectAction: "forEach",
readOnly: true readOnly: true
}, { }, {
name: "selectlineend", name: "selectlineend",
bindKey: bindKey("Shift-End", "Shift-End"), bindKey: "Shift-End",
exec: function(editor) { editor.getSelection().selectLineEnd(); }, exec: function(editor) { editor.getSelection().selectLineEnd(); },
multiSelectAction: "forEach", multiSelectAction: "forEach",
readOnly: true readOnly: true
@ -348,7 +358,7 @@ exports.commands = [{
exec: function(editor) { editor.redo(); } exec: function(editor) { editor.redo(); }
}, { }, {
name: "copylinesup", name: "copylinesup",
bindKey: bindKey("Ctrl-Alt-Up", "Command-Option-Up"), bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
exec: function(editor) { editor.copyLinesUp(); } exec: function(editor) { editor.copyLinesUp(); }
}, { }, {
name: "movelinesup", name: "movelinesup",
@ -356,7 +366,7 @@ exports.commands = [{
exec: function(editor) { editor.moveLinesUp(); } exec: function(editor) { editor.moveLinesUp(); }
}, { }, {
name: "copylinesdown", name: "copylinesdown",
bindKey: bindKey("Ctrl-Alt-Down", "Command-Option-Down"), bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
exec: function(editor) { editor.copyLinesDown(); } exec: function(editor) { editor.copyLinesDown(); }
}, { }, {
name: "movelinesdown", name: "movelinesdown",