~willvaughn/dots

ref: 1c07d5e3433db73753191f5168015ec20a518727 dots/.config/qutebrowser/qutemacs.py -rw-r--r-- 16.3 KiB
1c07d5e3William Vaughn quickmark abd bookmark delete, and open bookmark-list in tab 4 months ago
                                                                                
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
c = c
config = config

# Unbind standard qutebrowser bindings
c.bindings.default = {}
c.editor.command = ["emacsclient", "-c", "{file}"]

# Reload config
config.bind("<Ctrl-x><Ctrl-l>", "config-source")

# TODO: Review and incorporate normal default bindings
# config.bind("<Alt-m>", "tab-mute", mode="normal")
# config.bind("<Ctrl-h>", "home", mode="normal")
# config.bind("?", "set-cmd-text ?", mode="normal")
# config.bind("D", "tab-close -o", mode="normal")
# config.bind("PP", "open -t -- {primary}", mode="normal")
# config.bind("Pp", "open -t -- {clipboard}", mode="normal")
# config.bind("V", "mode-enter caret ;; selection-toggle --line", mode="normal")
# config.bind("ZQ", "quit", mode="normal")
# config.bind("gD", "tab-give", mode="normal")
# config.bind("gO", "set-cmd-text :open -t -r {url:pretty}", mode="normal")
# config.bind("gd", "download", mode="normal")
# config.bind("gf", "view-source", mode="normal")
# config.bind("gi", "hint inputs --first", mode="normal")
# config.bind("go", "set-cmd-text :open {url:pretty}", mode="normal")
# config.bind("h", "scroll left", mode="normal")
# config.bind("i", "mode-enter insert", mode="normal")
# config.bind("pP", "open -- {primary}", mode="normal")
# config.bind("pp", "open -- {clipboard}", mode="normal")
# config.bind("sk", "set-cmd-text -s :bind", mode="normal")
# config.bind("sl", "set-cmd-text -s :set -t", mode="normal")
# config.bind("ss", "set-cmd-text -s :set", mode="normal")
# config.bind("wO", "set-cmd-text :open -w {url:pretty}", mode="normal")
# config.bind("wP", "open -w -- {primary}", mode="normal")
# config.bind("wf", "hint all window", mode="normal")
# config.bind("wh", "back -w", mode="normal")
# config.bind("wl", "forward -w", mode="normal")
# config.bind("wp", "open -w -- {clipboard}", mode="normal")
# config.bind("xO", "set-cmd-text :open -b -r {url:pretty}", mode="normal")
# config.bind("xo", "set-cmd-text -s :open -b", mode="normal")

# normal
# Move around on the site
config.bind("b", "scroll-to-perc 0")
config.bind("e", "scroll-to-perc")
config.bind("<Ctrl-n>", "scroll down")
config.bind("<Ctrl-p>", "scroll up")
config.bind("<Ctrl-f>", "scroll right")
config.bind("<Ctrl-b>", "scroll left")
config.bind("<Ctrl-v>", "scroll-page 0 0.5")
config.bind("<Alt-v>",  "scroll-page 0 -0.5")
config.bind("<Ctrl-Shift-v>",  "scroll-page 0 -0.5")
config.bind("<Alt-n>", "navigate next")
config.bind("<Shift-Alt-n>", "navigate next -t")
config.bind("<Alt-p>", "navigate prev")
config.bind("<Shift-Alt-p>", "navigate prev -t")
config.bind("^", "navigate up")
config.bind("<Alt-Shift-^>", "navigate up -t")
config.bind("<Alt-f>", "navigate increment")
config.bind("<Alt-b>", "navigate decrement")
# Address
config.bind("<Ctrl-x><Ctrl-f>", "set-cmd-text -s :open -t")
config.bind("<Ctrl-u><Ctrl-x><Ctrl-f>", "set-cmd-text -s :open")
config.bind("l", "back")
config.bind("r", "forward")
config.bind("<Ctrl-x><Left>", "back")
config.bind("<Ctrl-x><Right>", "forward")
config.bind("g", "reload")
config.bind("<Ctrl-u>g", "reload -f")
config.bind("<F5>", "reload")
config.bind("<Ctrl-F5>", "reload -f")
# Quickmarks
config.bind("<Ctrl-x>rM", "quickmark-save")
config.bind("<Ctrl-x>rq", "set-cmd-text -s :quickmark-load -t")
config.bind("<Ctrl-x>rQ", "set-cmd-text -s :quickmark-load")
config.bind("<Ctrl-x>rK", "set-cmd-text -s :quickmark-del")
# Bookmarks
config.bind("<Ctrl-x>rm", "bookmark-add")
config.bind("<Ctrl-x>rl", "bookmark-list -t")
config.bind("<Ctrl-x>rb", "set-cmd-text -s :bookmark-load -t")
config.bind("<Ctrl-x>rB", "set-cmd-text -s :bookmark-load")
config.bind("<Ctrl-x>rk", "set-cmd-text -s :bookmark-del")
# Tabs
config.bind("<Ctrl-x>0", "tab-close")
config.bind("<Ctrl-x>k", "tab-close")
config.bind("k", "tab-close")
config.bind("<Ctrl-x>b", "set-cmd-text -s :buffer")
config.bind("<Ctrl-x>1", "tab-only")
config.bind("p", "tab-prev")
config.bind("P", "tab-move -")
config.bind("n", "tab-next")
config.bind("N", "tab-move +")
config.bind("<Ctrl-x>ta", "tab-focus 1")
config.bind("<Ctrl-x>te", "tab-focus last")
config.bind("<Ctrl-x>tp", "tab-pin")
config.bind("<Ctrl-x>to", "tab-next")
config.bind("<Ctrl-x>tO", "tab-prev")
config.bind("<Ctrl-x>t1", "tab-only")
config.bind("<Ctrl-x>tM", "tab-move -")
config.bind("<Ctrl-x>tm", "tab-move +")
config.bind("<Ctrl-x>n", "tab-clone")
config.bind("<Ctrl-x>t<Return>", "set-cmd-text -s :tab-select")
config.bind("<Ctrl-x>tt", "tab-focus")
config.bind("<Ctrl-PgDown>", "tab-next")
config.bind("<Ctrl-PgUp>", "tab-prev")
config.bind("<Ctrl-/>", "undo")
config.bind("<Alt-1>", "tab-focus 1")
config.bind("<Alt-2>", "tab-focus 2")
config.bind("<Alt-3>", "tab-focus 3")
config.bind("<Alt-4>", "tab-focus 4")
config.bind("<Alt-5>", "tab-focus 5")
config.bind("<Alt-6>", "tab-focus 6")
config.bind("<Alt-7>", "tab-focus 7")
config.bind("<Alt-8>", "tab-focus 8")
config.bind("<Alt-9>", "tab-focus -1")
config.bind("<Ctrl-Alt-p>", "print")
config.bind("<Ctrl-x>r<Space>", "mode-enter set_mark")
config.bind("<Ctrl-x>rj", "mode-enter jump_mark")
# Windows
config.bind("<Ctrl-x>5o", "set-cmd-text -s :open -w")
config.bind("<Ctrl-x>5p", "set-cmd-text -s :open -p")
config.bind("<Ctrl-x>u", "undo -w")
# Zooming
config.bind("+", "zoom-in")
config.bind("-", "zoom-out")
config.bind("=", "zoom")
# Copying/Yanking
config.bind("yD", "yank domain -s")
config.bind("yM", "yank inline [{title}]({url}) -s")
config.bind("yO", "yank inline [[{url}][{title}]] -s")
config.bind("yP", "yank pretty-url -s")
config.bind("yT", "yank title -s")
config.bind("yY", "yank -s")
config.bind("yd", "yank domain")
config.bind("ym", "yank inline [{title}]({url})")
config.bind("yp", "yank pretty-url")
config.bind("yt", "yank title")
config.bind("yy", "yank")
# Macros
config.bind("<F3>", "macro-record")
config.bind("<F4>", "macro-run")
config.bind("<Ctrl-x>(", "macro-record")
config.bind("<Ctrl-x>)", "macro-record")
config.bind("<Ctrl-x>e", "macro-run")
# Downloads
config.bind("ad", "download-cancel")
config.bind("cd", "download-clear")
# Devtools
config.bind("wi", "devtools")
config.bind("wIf", "devtools-focus")
config.bind("wIh", "devtools left")
config.bind("wIj", "devtools bottom")
config.bind("wIk", "devtools top")
config.bind("wIl", "devtools right")
config.bind("wIw", "devtools window")
# Config Cyclers
config.bind("tCH", "config-cycle -p -u *://*.{url:host}/* content.cookies.accept all no-3rdparty never ;; reload")
config.bind("tCh", "config-cycle -p -u *://{url:host}/* content.cookies.accept all no-3rdparty never ;; reload")
config.bind("tCu", "config-cycle -p -u {url} content.cookies.accept all no-3rdparty never ;; reload")
config.bind("tIH", "config-cycle -p -u *://*.{url:host}/* content.images ;; reload")
config.bind("tIh", "config-cycle -p -u *://{url:host}/* content.images ;; reload")
config.bind("tIu", "config-cycle -p -u {url} content.images ;; reload")
config.bind("tPH", "config-cycle -p -u *://*.{url:host}/* content.plugins ;; reload")
config.bind("tPh", "config-cycle -p -u *://{url:host}/* content.plugins ;; reload")
config.bind("tPu", "config-cycle -p -u {url} content.plugins ;; reload")
config.bind("tSH", "config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload")
config.bind("tSh", "config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload")
config.bind("tSu", "config-cycle -p -u {url} content.javascript.enabled ;; reload")
config.bind("tcH", "config-cycle -p -t -u *://*.{url:host}/* content.cookies.accept all no-3rdparty never ;; reload")
config.bind("tch", "config-cycle -p -t -u *://{url:host}/* content.cookies.accept all no-3rdparty never ;; reload")
config.bind("tcu", "config-cycle -p -t -u {url} content.cookies.accept all no-3rdparty never ;; reload")
config.bind("th", "back -t")
config.bind("tiH", "config-cycle -p -t -u *://*.{url:host}/* content.images ;; reload")
config.bind("tih", "config-cycle -p -t -u *://{url:host}/* content.images ;; reload")
config.bind("tiu", "config-cycle -p -t -u {url} content.images ;; reload")
config.bind("tl", "forward -t")
config.bind("tpH", "config-cycle -p -t -u *://*.{url:host}/* content.plugins ;; reload")
config.bind("tph", "config-cycle -p -t -u *://{url:host}/* content.plugins ;; reload")
config.bind("tpu", "config-cycle -p -t -u {url} content.plugins ;; reload")
config.bind("tsH", "config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload", mode="normal")
config.bind("tsh", "config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload", mode="normal")
config.bind("tsu", "config-cycle -p -t -u {url} content.javascript.enabled ;; reload", mode="normal")

# Miscellaneous
config.bind("<F11>", "fullscreen")
config.bind("<Return>", "selection-follow")
config.bind("<Ctrl-Return>", "selection-follow -t")
config.bind("<Ctrl-x>z", "repeat-command")
config.bind("<Escape>", "clear-keychain ;; search ;; fullscreen --leave")
config.bind("<Ctrl-g>", "clear-keychain ;; search ;; fullscreen --leave")
config.bind("<Ctrl-c><Ctrl-c>", "stop")
config.bind("<back>", "back")
config.bind("<forward>", "forward")
config.bind("<Ctrl-c>,", "set")
config.bind("<Ctrl-c>h", "history")
config.bind("<Ctrl-x>s", "session-save")
config.bind("<Ctrl-x>l", "session-load")
config.bind("<Ctrl-h>i", "help -t")
# Change modes
# caret
config.bind("<Ctrl-Space>", "mode-enter caret")
# command
config.bind("<Alt-x>", "set-cmd-text :")
# hint
config.bind("<Space>", "hint")
config.bind("<Alt-Space>", "hint all tab")
config.bind(";I", "hint images tab")
config.bind(";O", "hint links fill :open -t -r {hint-url}")
config.bind(";R", "hint --rapid links window")
config.bind(";W", "hint links yank-primary")
config.bind(";b", "hint all tab-bg")
config.bind(";d", "hint links download")
config.bind(";f", "hint all tab-fg")
config.bind(";h", "hint all hover")
config.bind(";i", "hint images")
config.bind(";o", "hint links fill :open {hint-url}")
config.bind(";r", "hint --rapid links tab-bg")
config.bind(";t", "hint inputs")
config.bind(";w", "hint links yank")
# insert
config.bind("<Ctrl-m>", "mode-enter insert")
# passthrough
config.bind("<Shift-Escape>", "mode-enter passthrough")
# Quit qutebrowser
config.bind("<Ctrl-x><Ctrl-c>", "quit --save")
config.bind("<Ctrl-u><Ctrl-x><Ctrl-c>", "quit")

# Insert mode
config.bind("<Escape>", "mode-leave", mode="insert")
config.bind("<Ctrl-g>", "mode-leave", mode="insert")
config.bind("<Ctrl-E>", "edit-text", mode="insert")

# Searching
config.bind("<Ctrl-s>", "set-cmd-text /")
config.bind("<Ctrl-r>", "set-cmd-text ?")
config.bind("<Ctrl-s>", "search-next", mode="command")
config.bind("<Ctrl-r>", "search-prev", mode="command")

# command mode
config.bind("<Alt-b>", "rl-backward-word", mode="command")
config.bind("<Alt-Backspace>", "rl-backward-kill-word", mode="command")
config.bind("<Alt-d>", "rl-kill-word", mode="command")
config.bind("<Alt-f>", "rl-forward-word", mode="command")
config.bind("<Ctrl-d>", "rl-delete-char", mode="command")
config.bind("<Ctrl-a>", "rl-beginning-of-line", mode="command")
config.bind("<Ctrl-e>", "rl-end-of-line", mode="command")
config.bind("<Ctrl-b>", "rl-backward-char", mode="command")
config.bind("<Ctrl-f", "rl-forward-char", mode="command")
config.bind("<Ctrl-k>", "rl-kill-line", mode="command")
config.bind("<Alt-Delete>", "rl-filename-rubout", mode="command")
config.bind("<Ctrl-w>", "rl-rubout \" \"", mode="command")
config.bind("<Ctrl-Shift-Backspace>", "rl-unix-line-discard", mode="command")
config.bind("<Ctrl-y>", "rl-yank", mode="command")
config.bind("<Alt-w>", "completion-item-yank", mode="command")
config.bind("<Alt-Shift-w>", "completion-item-yank --sel", mode="command")
config.bind("<Shift-Delete>", "completion-item-del", mode="command")
config.bind("<Up>", "command-history-prev", mode="command")
config.bind("<Alt-p>", "command-history-prev", mode="command")
config.bind("<Down>", "command-history-next", mode="command")
config.bind("<Alt-n>", "command-history-next", mode="command")
config.bind("<Shift-Tab>", "completion-item-focus prev", mode="command")
config.bind("<Ctrl-p>", "completion-item-focus prev", mode="command")
config.bind("<Tab>", "completion-item-focus next", mode="command")
config.bind("<Ctrl-n>", "completion-item-focus next", mode="command")
config.bind("<PgDown>", "completion-item-focus next-page", mode="command")
config.bind("<PgUp>", "completion-item-focus prev-page", mode="command")
config.bind("<Ctrl-c><Ctrl-f>", "completion-item-focus next-category", mode="command")
config.bind("<Ctrl-c><Ctrl-b>", "completion-item-focus prev-category", mode="command")
config.bind("<Ctrl-Return>", "command-accept --rapid", mode="command")
config.bind("<Escape>", "mode-leave", mode="command")
config.bind("<Ctrl-g>", "mode-leave", mode="command")
config.bind("<Return>", "command-accept", mode="command")
config.bind("<Ctrl-m>", "command-accept", mode="command")

# passthrough
config.bind("<Shift-Escape>", "mode-leave", mode="passthrough")

# prompt
config.bind("<Alt-b>", "rl-backward-word", mode="prompt")
config.bind("<Alt-Backspace>", "rl-backward-kill-word", mode="prompt")
config.bind("<Alt-d>", "rl-kill-word", mode="prompt")
config.bind("<Alt-f>", "rl-forward-word", mode="prompt")
config.bind("<Ctrl-d>", "rl-delete-char", mode="prompt")
config.bind("<Ctrl-a>", "rl-beginning-of-line", mode="prompt")
config.bind("<Ctrl-e>", "rl-end-of-line", mode="prompt")
config.bind("<Ctrl-b>", "rl-backward-char", mode="prompt")
config.bind("<Ctrl-f>", "rl-forward-char", mode="prompt")
config.bind("<Ctrl-k>", "rl-kill-line", mode="prompt")
config.bind("<Alt-Delete>", "rl-filename-rubout", mode="prompt")
config.bind("<Ctrl-w>", "rl-rubout \" \"", mode="prompt")
config.bind("<Ctrl-Shift-Backspace>", "rl-unix-line-discard", mode="prompt")
config.bind("<Ctrl-y>", "rl-yank", mode="prompt")
config.bind("<Ctrl-p>", "prompt-item-focus prev", mode="prompt")
config.bind("<Shift-Tab>", "prompt-item-focus prev", mode="prompt")
config.bind("<Up>", "prompt-item-focus prev", mode="prompt")
config.bind("<Ctrl-n>", "prompt-item-focus next", mode="prompt")
config.bind("<Tab>", "prompt-item-focus next", mode="prompt")
config.bind("<Down>", "prompt-item-focus next", mode="prompt")
config.bind("<Ctrl-g>", "mode-leave", mode="prompt")
config.bind("<Escape>", "mode-leave", mode="prompt")
config.bind("<Ctrl-m>", "prompt-accept", mode="prompt")
config.bind("<Return>", "prompt-accept", mode="prompt")
config.bind("n", "prompt-accept no", mode="prompt")
config.bind("y", "prompt-accept yes", mode="prompt")
config.bind("<Ctrl-x><Ctrl-p>", "prompt-open-download --pdfjs", mode="prompt")
config.bind("<Ctrl-x><Ctrl-o>", "prompt-open-download", mode="prompt")
config.bind("<Alt-e>", "prompt-fileselect-external", mode="prompt")
config.bind("<Alt-Shift-y>", "prompt-yank --sel", mode="prompt")
config.bind("<Alt-y>", "prompt-yank", mode="prompt")

# register
config.bind("<Ctrl-g>", "mode-leave", mode="register")
config.bind("<Escape>", "mode-leave", mode="register")

# yesno
config.bind("<Alt-Shift-Y>", "prompt-yank --sel", mode="yesno")
config.bind("<Alt-Y>", "prompt-yank", mode="yesno")
config.bind("<Ctrl-g>", "mode-leave", mode="yesno")
config.bind("<Escape>", "mode-leave", mode="yesno")
config.bind("<Return>", "prompt-accept", mode="yesno")
config.bind("N", "prompt-accept --save no", mode="yesno")
config.bind("Y", "prompt-accept --save yes", mode="yesno")
config.bind("n", "prompt-accept no", mode="yesno")
config.bind("y", "prompt-accept yes", mode="yesno")

# hinting
config.bind("<Escape>", "mode-leave", mode="hint")
config.bind("<Ctrl-g>", "mode-leave", mode="hint")
config.bind("<Return>", "hint-follow", mode="hint")
config.bind("<Ctrl-m>", "hint-follow", mode="hint")

# caret
config.bind("<Ctrl-Space>", "selection-toggle", mode="caret")
config.bind("<Escape>", "mode-leave", mode="caret")
config.bind("<Ctrl-g>", "mode-leave", mode="caret")
config.bind("b", "scroll-to-perc 0", mode="caret")
config.bind("e", "scroll-to-perc", mode="caret")
config.bind("<Ctrl-f>", "move-to-next-char", mode="caret")
config.bind("<Ctrl-b>", "move-to-prev-char", mode="caret")
config.bind("<Ctrl-n>", "move-to-next-line", mode="caret")
config.bind("<Ctrl-p>", "move-to-prev-line", mode="caret")
config.bind("<Ctrl-a>", "move-to-start-of-line", mode="caret")
config.bind("<Ctrl-e>", "move-to-end-of-line", mode="caret")
config.bind("<Alt-f>", "move-to-next-word", mode="caret")
config.bind("<Alt-b>", "move-to-prev-word", mode="caret")
config.bind("<Alt-Shift-{>", "move-to-end-of-prev-block", mode="caret")
config.bind("<Alt-Shift-}>", "move-to-end-of-next-block", mode="caret")
config.bind("<Alt-w>", "yank selection", mode="caret")

# Search engins
c.url.searchengines = {
    "DEFAULT": "https://duckduckgo.com/?q={}",
    "g": "https://google.com/search?q={}",
}