-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig.py
81 lines (65 loc) · 2.98 KB
/
config.py
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
# pyright: reportUndefinedVariable=false
from os import getenv
from os.path import join
## General
# -----------------------------------------------------------------------------
config.load_autoconfig(False)
c.search.incremental = False
c.spellcheck.languages = ["en-US", "de-DE"]
terminal, editor = getenv("TERMCMD", "alacritty"), getenv("EDITOR", "nvim")
c.editor.command = [terminal, "-e", editor, "{file}", "+norm{line}G{column0}l"]
c.confirm_quit = ["downloads", "multiple-tabs"]
#c.auto_save.session = True
c.downloads.location.directory = "~/Downloads"
c.downloads.location.prompt = False
c.downloads.open_dispatcher = join(config.configdir, "userscripts/dispatcher")
c.tabs.last_close = "close"
c.tabs.select_on_remove = "last-used"
c.tabs.show = "multiple"
c.content.cookies.store = False
c.content.cookies.accept = "no-3rdparty"
#c.content.pdfjs = True
#c.content.javascript.enabled = False
#content.javascript.clipboard = True
## Search Engines
# -----------------------------------------------------------------------------
c.url.open_base_url = True
for bang in ["!jt", "!jotoba"]:
c.url.searchengines[bang] = 'https://jotoba.de/search/{quoted}'
## Colorscheme
# -----------------------------------------------------------------------------
c.colors.webpage.preferred_color_scheme = "dark"
config.source("colorschemes/gruvbox.py")
## Keybindings & Aliases
# -----------------------------------------------------------------------------
for mode in ["normal", "caret"]:
config.bind("gs", "spawn --userscript yomichad", mode=mode)
config.bind("gS", "spawn --userscript yomichad --prefix-search", mode=mode)
config.bind("<Ctrl-e>", "scroll down")
config.bind("<Ctrl-y>", "scroll up")
config.bind("ao", "download-open")
optval = "content.javascript.clipboard access access-paste none ;; reload"
config.bind("tXH", " ".join(["config-cycle -pu *://*.{url:host}/*", optval]))
config.bind("tXh", " ".join(["config-cycle -pu *://{url:host}/*", optval]))
config.bind("tXu", " ".join(["config-cycle -pu {url}", optval]))
config.bind("txH", " ".join(["config-cycle -ptu *://*.{url:host}/*", optval]))
config.bind("txh", " ".join(["config-cycle -ptu *://{url:host}/*", optval]))
config.bind("txu", " ".join(["config-cycle -ptu {url}", optval]))
c.aliases.update({
"zotero": "spawn --userscript zotero",
"Zotero": "hint links userscript zotero",
"proxy": "spawn ssh proxy ;; set -t content.proxy socks5://localhost:8080",
"noproxy": "spawn ssh -O exit proxy ;; config-unset -t content.proxy",
"login": "open -p http://neverssl.com",
})
## Per-domain
# -----------------------------------------------------------------------------
with config.pattern("www.duden.de") as p:
p.content.blocking.enabled = False
with config.pattern("jisho.org") as p:
p.input.insert_mode.leave_on_load = False
with config.pattern("meet.jit.si") as p:
p.content.desktop_capture = True
p.content.media.audio_capture = True
p.content.media.video_capture = True
p.content.media.audio_video_capture = True