Sublime Text bindings demo
The sublime
keymap defines many Sublime Text-specific
bindings for CodeMirror. See the code below for an overview.
Enable the keymap by
loading keymap/sublime.js
and setting
the keyMap
option to "sublime"
.
(A lot of the search functionality is still missing.)
xxxxxxxxxx
cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
1
// The bindings defined specifically in the Sublime Text mode
2
var bindings = {
3
"Shift-Tab": "indentLess",
4
"Shift-Ctrl-K": "deleteLine",
5
"Alt-Q": "wrapLines",
6
"Ctrl-T": "transposeChars",
7
"Alt-Left": "goSubwordLeft",
8
"Alt-Right": "goSubwordRight",
9
"Ctrl-Up": "scrollLineUp",
10
"Ctrl-Down": "scrollLineDown",
11
"Ctrl-L": "selectLine",
12
"Shift-Ctrl-L": "splitSelectionByLine",
13
"Esc": "singleSelectionTop",
14
"Ctrl-Enter": "insertLineAfter",
15
"Shift-Ctrl-Enter": "insertLineBefore",
16
"Ctrl-D": "selectNextOccurrence",
17
"Shift-Ctrl-Space": "selectScope",
18
"Shift-Ctrl-M": "selectBetweenBrackets",
19
"Ctrl-M": "goToBracket",
20
"Shift-Ctrl-Up": "swapLineUp",
21
"Shift-Ctrl-Down": "swapLineDown",
22
"Ctrl-/": "toggleCommentIndented",
23
"Ctrl-J": "joinLines",
24
"Shift-Ctrl-D": "duplicateLine",
25
"F9": "sortLines",
26
"Ctrl-F9": "sortLinesInsensitive",
27
"F2": "nextBookmark",
28
"Shift-F2": "prevBookmark",
29
"Ctrl-F2": "toggleBookmark",
30
"Shift-Ctrl-F2": "clearBookmarks",
31
"Alt-F2": "selectBookmarks",
32
"Backspace": "smartBackspace",
33
"Ctrl-K Ctrl-K": "delLineRight",
34
"Ctrl-K Ctrl-U": "upcaseAtCursor",
35
"Ctrl-K Ctrl-L": "downcaseAtCursor",
36
"Ctrl-K Ctrl-Space": "setSublimeMark",
37
"Ctrl-K Ctrl-A": "selectToSublimeMark",
38
"Ctrl-K Ctrl-W": "deleteToSublimeMark",
39
"Ctrl-K Ctrl-X": "swapWithSublimeMark",