-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.surfingkeys.js
82 lines (55 loc) · 1.7 KB
/
.surfingkeys.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
settings.theme = `
#sk_status, #sk_find {
font-family:system-ui;
right: 5%;
}
}`;
settings.showModeStatus = true
settings.smoothScroll = false
var navSites = /gmail.com|twitter.com|feedly.com|reddit.com/
unmap('j', navSites);
unmap('k', navSites);
unmap('l', /twitter.com/)
unmap('r', /feedly.com/)
// cvim like bindings
map('J', 'E')
map('K', 'R')
map('H', 'S')
map('L', 'D')
map('i', '<Alt-i>')
map('F', 'C')
unmapAllExcept(['J', 'K', '<Esc>'], /todoist.com/)
unmapAllExcept(['i', 'f', 'J', 'K', '<Esc>'], /messenger.com/)
var godown = function () {
var sibling = document
.querySelector('[aria-label="Conversation List"] > [aria-relevant]')
.nextSibling;
if (sibling !== null) {
var link = sibling.querySelector('[role=link]');
if (link !== null) {
link.click();
}
}
};
mapkey('<Ctrl-j>', 'next convo', godown, {domain: /messenger\.com/i});
imapkey('<Ctrl-j>', 'next convo', godown, {domain: /messenger\.com/i});
var goup = function () {
var sibling = document
.querySelector('[aria-label="Conversation List"] > [aria-relevant]')
.previousElementSibling;
if (sibling !== null) {
var link = sibling.querySelector('[role=link]');
if (link !== null) {
link.click();
}
}
};
mapkey('<Ctrl-k>', 'next convo', goup, {domain: /messenger\.com/i});
imapkey('<Ctrl-k>', 'next convo', goup, {domain: /messenger\.com/i});
if (self.origin === "https://www.messenger.com" ) {
// don't focus input box
settings.enableAutoFocus = true;
}
unmapAllExcept(['i', 'f', 'J', 'K', '<Esc>'], /mail.google.com/)
Hints.style('font-family:system-ui;font-weight: normal;');
iunmap(":");