-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsublime.js
64 lines (53 loc) · 1.58 KB
/
sublime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function(){
ace.require('ace/ext/language_tools');
var el = document.createElement('div');
el.id = 'editor';
var editor = ace.edit(el);
editor.setTheme('ace/theme/monokai');
editor.setFadeFoldWidgets(true);
editor.setShowPrintMargin(false);
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
fontFamily: 'Cousine',
fontSize: '10pt'
});
editor.commands.addCommand({
name: "removeline",
bindKey: bindKey("Ctrl-D|Shift-Del", "Command-D"),
exec: function(editor){ editor.removeLines(); },
scrollIntoView: "cursor",
multiSelectAction: "forEachLine"
});
editor.commands.addCommand({
name: "copylinesup",
bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
exec: function(editor){ editor.copyLinesUp(); },
scrollIntoView: "cursor"
});
editor.commands.addCommand({
name: "movelinesup",
bindKey: bindKey("Alt-Up|Ctrl-Shift-Up", "Option-Up"),
exec: function(editor){ editor.moveLinesUp(); },
scrollIntoView: "cursor"
});
editor.commands.addCommand({
name: "copylinesdown",
bindKey: bindKey("Alt-Shift-Down|Ctrl-Shift-D", "Command-Option-Down"),
exec: function(editor){ editor.copyLinesDown(); },
scrollIntoView: "cursor"
});
editor.commands.addCommand({
name: "movelinesdown",
bindKey: bindKey("Alt-Down|Ctrl-Shift-Down", "Option-Down"),
exec: function(editor){ editor.moveLinesDown(); },
scrollIntoView: "cursor"
});
return {
el: el,
editor: editor
};
};
function bindKey(win, mac){
return { win: win, mac: mac };
}