-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.js
157 lines (131 loc) · 3.83 KB
/
config.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// A very tridactyl-esque config file.
// Compatibility Prefix
const {
Clipboard,
Front,
Hints,
Normal,
RUNTIME,
Visual,
aceVimMap,
addSearchAlias,
cmap,
getClickableElements,
imap,
imapkey,
iunmap,
map,
mapkey,
readText,
removeSearchAlias,
tabOpenLink,
unmap,
unmapAllExcept,
vmapkey,
vunmap
} = api;
// ---- Settings ----
Hints.setCharacters('asdfgyuiopqwertnmzxcvb');
settings.defaultSearchEngine = 'd';
settings.hintAlign = 'left';
settings.omnibarPosition = 'bottom';
settings.focusFirstCandidate = false;
settings.focusAfterClosed = 'last';
settings.scrollStepSize = 200;
settings.tabsThreshold = 0;
settings.modeAfterYank = 'Normal';
// ---- Map -----
// --- Hints ---
// Open Multiple Links
map('<Alt-f>', 'cf');
// Yank Link URL
map('<Alt-y>', 'ya');
map('<Alt-u>', 'ya');
// Open Hint in new tab
map('F', 'C');
// --- Nav ---
// Open Clipboard URL in current tab
mapkey('p', "Open the clipboard's URL in the current tab", () => { Clipboard.read(function(response) { window.location.href = response.data; }); });
// Open Clipboard URL in new tab
map('P', 'cc');
// Open a URL in current tab
map('o', 'go');
// Choose a buffer/tab
map('b', 'T');
// Edit current URL, and open in same tab
map('O', ';U');
// Edit current URL, and open in new tab
map('T', ';u');
// History Back/Forward
map('H', 'S');
map('L', 'D');
// Scroll Page Down/Up
mapkey("<Ctrl-d>", "Scroll down", () => { Normal.scroll("pageDown"); });
mapkey("<Ctrl-u>", "Scroll up", () => { Normal.scroll("pageUp"); });
map('<Ctrl-b>', 'U'); // scroll full page up
//map('<Ctrl-f>', 'P'); // scroll full page down -- looks like we can't overwrite browser-native binding
// Next/Prev Page
map('K', '[[');
map('J', ']]');
// Open Chrome Flags
mapkey('gF', '#12Open Chrome Flags', () => { tabOpenLink("chrome://flags/"); });
// --- Tabs ---
// Tab Delete/Undo
map('D', 'x');
mapkey('d', '#3Close current tab', () => { RUNTIME("closeTab"); });
mapkey('u', '#3Restore closed tab', () => { RUNTIME("openLast"); });
// Move Tab Left/Right w/ one press
map('>', '>>');
map('<', '<<');
// Tab Next/Prev
map('<Alt-j>', 'R');
map('<Alt-k>', 'E');
// --- Misc ---
// Yank URL w/ one press (disables other yx binds)
map('y', 'yy');
// Change focused frame
map('gf', 'w');
// ---- Unmap -----
// Proxy Stuff
unmap('spa');
unmap('spb');
unmap('spc');
unmap('spd');
unmap('sps');
unmap('cp');
unmap(';cp');
unmap(';ap');
// Emoji
iunmap(":");
// Misc
unmap(';t');
unmap('si');
unmap('ga');
unmap('gc');
unmap('gn');
unmap('gr');
unmap('ob');
unmap('og');
unmap('od');
unmap('oy');
// ---- Search Engines -----
removeSearchAlias('b', 's');
removeSearchAlias('d', 's');
removeSearchAlias('g', 's');
removeSearchAlias('h', 's');
removeSearchAlias('w', 's');
removeSearchAlias('y', 's');
removeSearchAlias('s', 's');
addSearchAlias('ama', 'amazon', 'https://www.amazon.com/s?k=', 's');
addSearchAlias('ap', 'arch pkg', 'https://www.archlinux.org/packages/?sort=&q=', 's');
addSearchAlias('aur', 'aur', 'https://aur.archlinux.org/packages/?O=0&SeB=nd&K=', 's');
addSearchAlias('aw', 'arch wiki', 'https://wiki.archlinux.org/index.php?title=Special:Search&search=', 's');
addSearchAlias('d', 'ddg', 'https://duckduckgo.com/?q=', 's');
addSearchAlias('dh', 'docker', 'https://hub.docker.com/search?type=image&q=', 's');
addSearchAlias('fh', 'flathub', 'https://flathub.org/apps/search/', 's');
addSearchAlias('gh', 'github', 'https://github.com/search?q=', 's');
addSearchAlias('pdb', 'proton', 'https://www.protondb.com/search?q=', 's');
addSearchAlias('r', 'reddit', 'https://libreddit.spike.codes/r/', 's');
addSearchAlias('st', 'steam', 'https://store.steampowered.com/search/?term=', 's');
addSearchAlias('wiki', 'wikipedia', 'https://en.wikipedia.org/wiki/Special:Search/', 's');
addSearchAlias('y', 'yt', 'https://invidious.snopyta.org/search?q=', 's');