· 8 years ago · Apr 03, 2018, 01:28 AM
1// General
2
3settings.richHintsForKeystroke=false;
4settings.hintAlign = "left";
5settings.tabsThreshold = 20;
6settings.useLocalMarkdownAPI=false;
7settings.focusFirstCandidate=true;
8// an example to create a new mapping `ctrl-y`
9mapkey('<Ctrl-y>', 'Show me the money', function() {
10 Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
11});
12
13// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
14//map('gt', 'T');
15
16// an example to remove mapkey `Ctrl-i`
17//unmap('<Ctrl-i>');
18
19
20// Insert
21imap('<Ctrl-w>', "<Alt-w>");
22imap('<Ctrl-a>', "<Ctrl-f>");
23// Action
24
25map('P', 'sg');
26//map('Y', 'yy');
27//map('O', 't');
28//map('o', '<Ctrl-l>'); // open in current tab
29
30//unmap('B')
31//unmap('F')
32map('F', 'af');
33map('H', 'S')
34map('L', 'D')
35
36map('<Ctrl-n>', 'R')
37map('<Ctrl-p>', 'E')
38map('<Ctrl-f>', 'd')
39map('<Ctrl-b>', 'u')
40map('d', 'x')
41map('u', 'X')
42
43
44//unmap('T')
45//map('B', 'b')
46map('b', 'T')
47//map('o', 'go')
48
49
50mapkey('B', '#8Open a bookmark', function() {
51 Front.openOmnibar(({type: "Bookmarks"}));
52});
53//
54//mapkey('o', '#8Open a URL in current tab', function() {
55// Front.openOmnibar({type: "URLs", extra: "getAllSites", tabbed: false});
56//});
57//
58//mapkey('H', '#4Go back in history', 'history.go(-1)', {repeatIgnore: true});
59//mapkey('L', '#4Go forward in history', 'history.go(1)', {repeatIgnore: true});
60//mapkey('b', '#3Choose a tab', 'Front.chooseTab()');
61
62
63
64// only keep E, R and T from Surfingkeys for gmail.com and twitter.com
65unmapAllExcept(['<Ctrl-p>','<Ctrl-n>', '<Ctrl-i>', 'b','go', 't'], /mail.google\.com|gmail\.com|twitter\.com/);
66
67// set theme
68settings.theme = `
69.sk_theme {
70 background: #000;
71 color: #fff;
72}
73.sk_theme tbody {
74 color: #fff;
75}
76.sk_theme input {
77 color: #d9dce0;
78}
79.sk_theme .url {
80 color: #2173c5;
81}
82.sk_theme .annotation {
83 color: #38f;
84}
85.sk_theme .omnibar_highlight {
86 color: #fbd60a;
87}
88.sk_theme ul>li:nth-child(odd) {
89 background: #1e211d;
90}
91.sk_theme ul>li.focused {
92 background: #4ec10d;
93}`;
94// click `Save` button to make above settings to take effect.