summary refs log tree commit diff
path: root/.config/tridactyl/tridactylrc
blob: 526b7eb6f72ffc3253baefb3c959cf974294360a (plain) (blame)
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
" vim: ft=vim
sanitise tridactyllocal tridactylsync
colors r

set browser librewolf
set allowautofocus false
set searchengine duckduckgonoai
set editorcmd foot -a foot-float -T tridactyl-editor -- nvim
set historyresults 50
" set newtab https://html.duckduckgo.com
set allowautofocus true
set newtabfocus page
set leavegithubalone true
" set blacklistkeys ["/","<Space>",";"]

set modeindicator true
set modeindicatorshowkeys true

" remove annoying binds
unbind <C-f>
unbind <C-a>
unbind --mode=ex <C-a> " select all in cmdline
unbind --mode=browser <C-,>

bind n findnext 1
bind N findnext -1

" hint: mpv/video
set exaliases.mpvsafe js -p tri.excmds.shellescape(JS_ARG).then(u => tri.excmds.exclaim_quiet(`play-mpv ${u}`))
bind gv composite get_current_url | mpvsafe
bind yv composite getclip | mpvsafe
bind ;v hint -W mpvsafe

"bind ;e hint -hW js -p tri.excmds.exclaim_quiet(`${tri.config.get('editorcmd')} /tmp/tridactl.${document.location.hostname}.txt '+normal!i${JS_ARG}'`)

set exaliases.imgsafe js -p tri.excmds.shellescape(JS_ARG).then(u => tri.excmds.exclaim_quiet(`fyi 'tridactyl::mvi' ${u} && mvi ${u}`))
bind ;i composite hint -Jpipe img | js -p JS_ARG.src | imgsafe

bind gp composite get_current_url | winopen -popup
bind g1 tab 2
bind g2 tab 3
bind g3 tab 4
bind g4 tab 5
bind gb tab #

# mapswap
command mapswap js tri.excmds.tabopen("https://mapswap.trailsta.sh/swap/#type="+(()=>{let q=x=>document.querySelector(x);return q('.leaflet-container')?'l':q('.maplibregl-map')||q('.mapboxgl-map')?'m':q('.ol-viewport')?'ol':''})()+"&url="+encodeURIComponent(window.location))
bind gms mapswap

" hackernews hinting
bindurl news.ycombinator.com ;c hint -fr \d+\scomments
bindurl news.ycombinator.com gr hint -c [class*="storylink"]

" ddg result hinting
bindurl duckduckgo.com gr hint -c article > div > h2

" fix github
unbindurl github.com /

" fix gitlab
unbindurl gitlab.freedesktop.org /

" fix youtube
seturl youtube.com noiframe true
unbindurl youtube.com f
unbindurl youtube.com 1
unbindurl youtube.com 2
unbindurl youtube.com 3
unbindurl youtube.com 4
unbindurl youtube.com 5
unbindurl youtube.com 6
unbindurl youtube.com 7
unbindurl youtube.com 8
unbindurl youtube.com 9
unbindurl youtube.com <Space>
bindurl youtube.com h hint
bindurl youtube.com T tabopen ddg.gg
bindurl youtube.com C recontain personal

" fix twitch
unbindurl twitch.tv <Space>

" fix reddit
seturl reddit.com allowautofocus true
unbindurl reddit.com <Escape>
unbindurl reddit.com j
unbindurl reddit.com k
unbindurl reddit.com N
unbindurl reddit.com P
unbindurl reddit.com n
unbindurl reddit.com p
unbindurl reddit.com a
unbindurl reddit.com z
unbindurl reddit.com c
" unbindurl reddit.com r
unbindurl reddit.com s
unbindurl reddit.com h
unbindurl reddit.com x
unbindurl reddit.com l

" fix 4chan
unbindurl boards.4chan.*.org x
unbindurl boards.4chan.*.org T
unbindurl boards.4chan.*.org B
unbindurl boards.4chan.*.org n
unbindurl boards.4chan.*.org p
unbindurl boards.4chan.*.org F
unbindurl boards.4chan.*.org W
unbindurl boards.4chan.*.org <C-j>
unbindurl boards.4chan.*.org <C-k>

" fix nebula
unbindurl nebula.tv f
unbindurl nebula.tv k
unbindurl nebula.tv m
unbindurl nebula.tv c
unbindurl nebula.tv s

" fix zigdocs
unbindurl ziglang.org s

bindurl wiki.openstreetmap.org --mode=normal E editor
bindurl wiki.openstreetmap.org --mode=input E editor
bindurl wikipedia.org --mode=normal E editor
bindurl wikipedia.org --mode=input E editor

" start in ignore mode
blacklistadd console.hetzner.cloud/console
blacklistadd docs.google.com
blacklistadd gather.town
blacklistadd monkeytype.com
blacklistadd typeform.com
blacklistadd typingclub.com
blacklistadd maplibre.org
blacklistadd excalidraw.com

" almost fully disable tridactyl
seturl localhost* superignore true

" put autocontains into the per-profile config
js tri.native.getProfile().then(p => tri.excmds.source_quiet(`~/.config/tridactyl/tridactylrc.${last(p.Path.split('.'))}`))