## browser config

# don't load autoconfig
config.load_autoconfig(False)

# appearance
config.source('gruvbox.py')

# editor
c.editor.command = ['alacritty', '-T', 'auxiliary text edit', '-e', 'nvim', '{file}', '+call cursor({line}, {column})']

# auto save session
c.auto_save.session = True

# set dark mode
c.colors.webpage.darkmode.enabled = True

# spell checking
c.spellcheck.languages = ['en-US', 'en-GB', 'pl-PL']

# built-in adblocker
c.content.blocking.method = 'both'

## key bindings

# swap J and K
config.bind('J', 'tab-prev')
config.bind('K', 'tab-next')

# toggle dark mode
config.bind('td', 'config-cycle colors.webpage.darkmode.enabled true false')

# source config
config.bind('cs', 'config-source')

# unfocus text field after exiting insert mode
config.bind('<Escape>', 'mode-leave ;; jseval -q document.activeElement.blur()', mode='insert')

# view videos in mpv
config.bind(',m', 'spawn mpv {url}')
config.bind(',M', 'hint links spawn mpv {hint-url}')
