Skip to content

Commit 63aa0df

Browse files
authored
Merge pull request #2696 from gnestor/cm-keymaps
Add missing codemirror keymaps to keyboard shortcuts dialog
2 parents cf6d305 + 65598bf commit 63aa0df

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

notebook/static/notebook/js/quickhelp.js

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,45 @@ define([
3636
// Mac OS X specific
3737
cmd_ctrl = 'Cmd-';
3838
platform_specific = [
39-
{ shortcut: "Cmd-Up", help:i18n.msg._("go to cell start") },
40-
{ shortcut: "Cmd-Down", help:i18n.msg._("go to cell end") },
41-
{ shortcut: "Alt-Left", help:i18n.msg._("go one word left") },
42-
{ shortcut: "Alt-Right", help:i18n.msg._("go one word right") },
43-
{ shortcut: "Alt-Backspace", help:i18n.msg._("delete word before") },
44-
{ shortcut: "Alt-Delete", help:i18n.msg._("delete word after") },
39+
{ shortcut: "Cmd-Up", help:i18n.msg._("go to cell start") },
40+
{ shortcut: "Cmd-Down", help:i18n.msg._("go to cell end") },
41+
{ shortcut: "Alt-Left", help:i18n.msg._("go one word left") },
42+
{ shortcut: "Alt-Right", help:i18n.msg._("go one word right") },
43+
{ shortcut: "Alt-Backspace", help:i18n.msg._("delete word before") },
44+
{ shortcut: "Alt-Delete", help:i18n.msg._("delete word after") },
45+
{ shortcut: "Cmd-Shift-z", help:i18n.msg._("redo") },
46+
{ shortcut: "Cmd-Shift-u", help:i18n.msg._("redo selection") },
47+
{ shortcut: "Ctrl-k", help:i18n.msg._("emacs-style line kill") },
48+
{ shortcut: "Cmd-Backspace", help:i18n.msg._("delete line left of cursor") },
49+
{ shortcut: "Cmd-Delete", help:i18n.msg._("delete line right of cursor") }
4550
];
4651
} else {
4752
// PC specific
4853
platform_specific = [
49-
{ shortcut: "Ctrl-Home", help:i18n.msg._("go to cell start") },
50-
{ shortcut: "Ctrl-Up", help:i18n.msg._("go to cell start") },
51-
{ shortcut: "Ctrl-End", help:i18n.msg._("go to cell end") },
52-
{ shortcut: "Ctrl-Down", help:i18n.msg._("go to cell end") },
53-
{ shortcut: "Ctrl-Left", help:i18n.msg._("go one word left") },
54-
{ shortcut: "Ctrl-Right", help:i18n.msg._("go one word right") },
55-
{ shortcut: "Ctrl-Backspace", help:i18n.msg._("delete word before") },
56-
{ shortcut: "Ctrl-Delete", help:i18n.msg._("delete word after") },
54+
{ shortcut: "Ctrl-Home", help:i18n.msg._("go to cell start") },
55+
{ shortcut: "Ctrl-Up", help:i18n.msg._("go to cell start") },
56+
{ shortcut: "Ctrl-End", help:i18n.msg._("go to cell end") },
57+
{ shortcut: "Ctrl-Down", help:i18n.msg._("go to cell end") },
58+
{ shortcut: "Ctrl-Left", help:i18n.msg._("go one word left") },
59+
{ shortcut: "Ctrl-Right", help:i18n.msg._("go one word right") },
60+
{ shortcut: "Ctrl-Backspace", help:i18n.msg._("delete word before")},
61+
{ shortcut: "Ctrl-Delete", help:i18n.msg._("delete word after")},
62+
{ shortcut: "Ctrl-y", help:i18n.msg._("redo")},
63+
{ shortcut: "Alt-u", help:i18n.msg._("redo selection") }
5764
];
5865
}
5966

6067
var cm_shortcuts = [
61-
{ shortcut:"Tab", help:i18n.msg._("code completion or indent") },
62-
{ shortcut:"Shift-Tab", help:i18n.msg._("tooltip") },
63-
{ shortcut: cmd_ctrl + "]", help:i18n.msg._("indent") },
64-
{ shortcut: cmd_ctrl + "[", help:i18n.msg._("dedent") },
65-
{ shortcut: cmd_ctrl + "a", help:i18n.msg._("select all") },
66-
{ shortcut: cmd_ctrl + "z", help:i18n.msg._("undo") },
67-
{ shortcut: cmd_ctrl + "Shift-z", help:i18n.msg._("redo") },
68-
{ shortcut: cmd_ctrl + "y", help:i18n.msg._("redo") },
68+
{ shortcut:"Tab", help:i18n.msg._("code completion or indent") },
69+
{ shortcut:"Shift-Tab", help:i18n.msg._("tooltip") },
70+
{ shortcut: cmd_ctrl + "]", help:i18n.msg._("indent") },
71+
{ shortcut: cmd_ctrl + "[", help:i18n.msg._("dedent") },
72+
{ shortcut: cmd_ctrl + "a", help:i18n.msg._("select all") },
73+
{ shortcut: cmd_ctrl + "z", help:i18n.msg._("undo") },
74+
{ shortcut: cmd_ctrl + "/", help:i18n.msg._("comment") },
75+
{ shortcut: cmd_ctrl + "d", help:i18n.msg._("delete whole line") },
76+
{ shortcut: cmd_ctrl + "u", help:i18n.msg._("undo selection") },
77+
{ shortcut: "Insert", help:i18n.msg._("toggle overwrite flag") }
6978
].concat( platform_specific );
7079

7180
var mac_humanize_map = {

0 commit comments

Comments
 (0)