-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtridactylrc
323 lines (253 loc) · 11.8 KB
/
tridactylrc
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
" -*- mode: vimrc -*-
" I want "vim-like" behaviour where removing a line from here makes the
" setting disappear.
sanitise tridactyllocal tridactylsync
guiset_quiet gui full
" this has to be done after the guiset stuff?
colours shydactyl
set editorcmd emacsclient -a emacs
bind gd tabdetach
bind gD composite tabduplicate; tabdetach
quickmark z https://sueddeutsche.de
quickmark w https://www.wetter.com/regenradar/deutschland/augsburg/DE0000434.html?onboarding-map-zoom=true
" Only hint search results on Google and DDG (from
" https://github.com/tridactyl/tridactyl/blob/master/doc/newsletters/tips-and-tricks/1-hint-css-selectors.md
bindurl www.google.com f hint -Jc .rc > div > a
bindurl www.google.com F hint -Jbc .rc > div > a
bindurl ^https://duckduckgo.com f hint -Jc [class=result__a]
bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a]
bindurl ^https://www.startpage.com f hint -Jc a>h2
" Wikiwand is great, but let's copy the original URLs.
bindurl wikiwand.com yy composite js document.location.href.replace("wikiwand.com/en","wikipedia.org/wiki") | clipboard yank
" Make `gi` on GitHub take you to the search box
bindurl ^https://github.com gi hint -Vc .AppHeader-searchButton
set modeindicator false
" general (g)
set searchurls.gs https://startpage.com/sp/search?query=%s
set searchurls.gd https://duckduckgo.com/?q=
set searchurls.gg https://google.com/?q=
" pictures (p)
set searchurls.p https://startpage.com/sp/search?cat=images&query=%s
set searchurls.pd https://duckduckgo.com/?q=%s&t=h_&ia=images&iax=images
set searchurls.pg https://giphy.com/search/%s
" shops (s)
set searchurls.sa https://www.amazon.de/s/?field-keywords=
set searchurls.sb https://buch7.de/suche?utf8=%E2%9C%93&search=%s&category=&commit=Suchen
set searchurls.si https://www.idealo.de/preisvergleich/MainSearchProductCategory.html?q=%s
set searchurls.sn https://www.alle-noten.de/index.php?stoken=6F775873&lang=0&listtype=search&actcontrol=search&categorysearch=&cl=search&tpl=&oxloadid=&fnc=executefilter&fname=&he_dynamicfacet=&he_dynamicvalue=&he_dynamiccode=&he_dynamicurl=&attrfilter%5Bhe_kategorie%5D=CHG&attrfilter%5Bhe_besetzgruppe%5D=ACAP&attrfilter%5Bhe_stil%5D=&attrfilter%5Berxgrad%5D=&attrfilter%5Bhe_person%5D=&attrfilter%5Bhe_verlag%5D=&attrfilter%5Bhe_serie%5D=&attrfilter%5Bhe_neu%5D=&attrfilter%5Bhe_lager%5D=&searchparam=
" translate/language (t)
set searchurls.td https://dict.cc/?s=
set searchurls.tu https://www.duden.de/suchen/dudenonline/
set searchurls.tr https://www.urbandictionary.com/define.php?term=
set searchurls.to https://en.oxforddictionaries.com/definition/
set searchurls.tl https://www.linguee.de/deutsch-englisch/search?source=auto&query=
set searchurls.ts https://signdict.org/search?q=%s
" wikipedia (w)
set searchurls.we https://en.wikipedia.org/wiki/Special:Search/
set searchurls.wd https://de.wikipedia.org/wiki/Spezial:Suche/
" nix(os) (n)
set searchurls.np https://search.nixos.org/packages?channel=unstable&from=0&size=30&sort=relevance&query=%s
set searchurls.no https://search.nixos.org/options?channel=unstable&from=0&size=30&sort=relevance&query=%s
set searchurls.ng https://github.com/NixOS/nixpkgs/search?q=%s
" coding (c)
set searchurls.cg https://github.com/search?utf8=%E2%9C%93&type=&q=
set searchurls.ch https://www.haskell.org/hoogle/?hoogle=
set searchurls.cy https://hayoo.fh-wedel.de/?query=
" maps (m)
set searchurls.m https://www.openstreetmap.org/search?query=
set searchurls.mg https://maps.google.com/maps/search/
set searchurls.mgd https://www.google.com/maps/dir/%s1/%s2/
" research (r)
set searchurls.rs https://scholar.google.de/scholar?q=
" misc
set searchurls.y https://www.youtube.com/results?search_query=
" Since 2023-03-13 the default is Startpage. Reason: DuckDuckGo (which i used
" before) disabled the minus operator (and many more things it seems in the last
" months).
set searchengine gs
" bind / fillcmdline find
" bind ? fillcmdline find -?
" bind n findnext 1
" bind N findnext -1
" bind gh nohlsearch
set hintfiltermode vimperator-reflow
set hintchars uiaeosnrdt
set smoothscroll true
set yankto selection
set putfrom selection
set bmarkweight 10
autocmd DocStart "www\.overleaf\.com.*" "mode ignore"
autocmd TabEnter "www\.overleaf\.com.*" "mode ignore"
" From the example config file:
"
" Add helper commands that Mozillians think make Firefox irredeemably
" insecure. For details, read the comment at the top of this file.
command fixamo_quiet jsb tri.excmds.setpref("privacy.resistFingerprinting.block_mozAddonManager", "true").then(tri.excmds.setpref("extensions.webextensions.restrictedDomains", '""'))
command fixamo js tri.excmds.setpref("privacy.resistFingerprinting.block_mozAddonManager", "true").then(tri.excmds.setpref("extensions.webextensions.restrictedDomains", '""').then(tri.excmds.fillcmdline_tmp(3000, "Permissions added to user.js. Please restart Firefox to make them take affect.")))
"
" Make Tridactyl work on more sites at the expense of some security.
" For details, read the comment at the top of this file.
fixamo_quiet
" From the example config file:
"
" The following modification allows Tridactyl to function on more pages, e.g. raw GitHub pages.
" You may not wish to run this. Mozilla strongly feels that you shouldn't.
" Read https://wiki.mozilla.org/Security/CSP#Goals for more information.
"
" Equivalent to `set csp clobber` before it was removed.
" This weakens your defences against cross-site-scripting attacks
" and other types of code-injection by reducing the strictness
" of Content Security Policy on all sites in a couple of ways.
"
" We remove the sandbox directive
" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox
" which allows our iframe (and anyone else's) to run on any website.
"
" We weaken the style-src directive
" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src
" to allow us to theme our elements.
" This exposes you to 'cross site styling' attacks
" jsb browser.webRequest.onHeadersReceived.addListener(tri.request.clobberCSP,{urls:["<all_urls>"],types:["main_frame"]},["blocking","responseHeaders"])
" From the example config file:
"
" Inject Google Translate
" This (clearly) is remotely hosted code. Google will be sent the whole
" contents of the page you are on if you run `:translate`
" From https://github.com/jeremiahlee/page-translator
command translate js let googleTranslateCallback = document.createElement('script'); googleTranslateCallback.innerHTML = "function googleTranslateElementInit(){ new google.translate.TranslateElement(); }"; document.body.insertBefore(googleTranslateCallback, document.body.firstChild); let googleTranslateScript = document.createElement('script'); googleTranslateScript.charset="UTF-8"; googleTranslateScript.src = "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit&tl=&sl=&hl="; document.body.insertBefore(googleTranslateScript, document.body.firstChild);
" From the example config file:
"
" New reddit is bad
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
" Let's give Wikiwand a try.
autocmd DocStart ^http(s?)://.*.wikipedia.org js tri.excmds.urlmodify("-r", "^.*//([^.]*).wikipedia.org/wiki/(.*)", "https://www.wikiwand.com/$1/$2")
" " mappings {{{
" " general
" nmap -builtin -javascript <C-R> plugins.tabgroups.tabGroup.appTabs.map (function (tab) config.tabbrowser.reloadTab (tab))
" nmap -builtin <C-H> :rehash<CR>
" imap -builtin <C-H> :rehash<CR>
" " nmap -builtin <SPACE> :
" " GUI maps
" " remap unnerving stuff
" nmap <C-K> <NOP>
" nmap <C-F> <NOP>
" imap <C-F> <NOP>
" cmap <C-F> <NOP>
" cmap <C-G> <NOP>
" " nmap -builtin \\ <ESC>:toolbartoggle Add-on Bar<CR>
" nmap -builtin hg :noh<CR>
" nmap -builtin gh :noh<CR>
" nmap -builtin <C-N> <NOP>
" nmap -builtin <C-P> <NOP>
" " tab maps
" nmap -builtin (( :tabmove -1<CR>
" nmap -builtin )) :tabmove +1<CR>
" nmap -builtin <C-T> :tabduplicate<CR>
" " tab group maps
" " unmap s
" nmap ss -builtin :tabgroup -switch
" nmap sp -builtin :tabgroup -pushtab
" nmap sa -builtin :tabgroup -add
" nmap sr -builtin :tabgroup -remove
" " navigation maps
" nmap -builtin ga g0
" nmap -builtin ge g$
" nmap -builtin gl <C-6>
" nmap -builtin <leader>p :tabopen <S-Insert>
" " onsite maps
" nmap -builtin <leader>f :flashtoggle<CR>
" nmap -builtin <leader>w :private winopen
" " night mode toggling
" nmap -builtin gn :nightmodetoggle<CR>
" nmap -builtin gN :nightmodetoggletab<CR>
" command! -nargs=+ SearchRef tabopen scholar <args> | ieee <args> | springer <args> | acm <args>
" nmap -builtin SR :SearchRef
" " }}}
" "functions {{{
" " javascript <<EOF
" " function searchPerson (person) {
" " ex.tabopen ("google " + person)
" " }
" " EOF
" " }}}
" " autocmds {{{
" " automatically copy youtube video urls
" " autocmd LocationChange '^https://www\.youtube\.com/watch\?v=.*' :normal! yd
" " disable this annoying behaviour, again and again and again and...
" autocmd LocationChange * set! ui.key.menuAccessKeyFocuses=false
" " }}}
" " pentadactyl options {{{
" " GUI options
" " colorscheme simple_dark
" colorscheme ultimate
" set guioptions=Cbnrs
" " maximum number of items in a listing
" set maxitems=10
" " 1234567890 are too far away
" set hintkeys="uiaenrtd"
" " pass certain keys to certain webpages
" " set passkeys=feedly.com:jkvrnpomsJKV,ga,gh,gl,www.google.*/search*:<TAB><Up><Down><BS>,www.google.*/calendar*:npjk
" set passkeys=www.inoreader.com.*:r1234+-0!@#jknpovbmfJKNPOWX,gf,ga,gu,www.google.*/search*:<TAB><Up><Down><BS>,calendar.google.*/calendar*:npjk
" " default search/suggest engine: google
" set defsearch=google
" set suggestengines=google
" " completion priority in :[tab]open
" set complete=location,search,bookmark,suggestion
" " focus newly opened tabs automatically (but not diverted, links)
" set activate=addons,bookmarks,downloads,extoptions,help,homepage,quickmark,tabopen,paste
" " TODO: unset this on google search site
" " scroll height of <C-d> / <C-u>
" " set scroll=3
" " match anywhere inside text of hinted links
" set hintmatching=contains
" " need <CR> anytime in hints mode
" set followhints=1
" " all type pages are opened in new tab
" " addons + downloads + help + javascript + prefs
" set newtab=all
" "}}}
" " plugin options {{{
" loadplugins
" " where to go on tabclosing
" set tabclose=opener,left,previous,right
" " where to open new tabs
" set tabopen=link:end,orphan:end,external:end
" " don't block flash on these sites
" " set fbwhitelist=https://www.youtube.com*,http://www.dict.cc*,http://vimeo.com*
" " alternative user agent strings
" " -useragent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16"
" "["iphone-3",
" "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
" "Mozilla",
" "Netscape",
" "5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
" "iPhone",
" "Apple Computer, Inc.",
" ""]
" "javascript <<EOF
" "plugins.useragent.useragents["ipad"] = plugins.useragent.UserAgent.fromArray ([
" " // useragent
" " "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
" " // appname
" " "Mozilla",
" " // appcodename
" " "Netscape",
" " // appversion
" " "5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
" " // platform
" " "iPad",
" " // vendor
" " "Apple Computer, Inc."
" "])
" "EOF
" " }}}
" " firefox options" {{{
" " sadly disabled in ff 31
" " hide close buttons
" " set! browser.tabs.closeButtons=2
" " open tab in the background
" set! browser.tabs.loadDivertedInBackground=true
" " disable alt-key bringing up menu
" set! ui.key.menuAccessKeyFocuses=false
" " }}}
" " vim: ft=vim ts=4 sw=4 sts=0 et fdm=marker fdc=3