diff --git a/.flake8 b/.flake8 index eada2c86d..1d33859fc 100644 --- a/.flake8 +++ b/.flake8 @@ -43,6 +43,8 @@ putty-ignore = tests/helpers/fixtures.py : +N806 tests/unit/browser/webkit/http/test_content_disposition.py : +D400 scripts/dev/ci/appveyor_install.py : +FI53 + # FIXME:conf + tests/unit/completion/test_models.py : +F821 copyright-check = True copyright-regexp = # Copyright [\d-]+ .* copyright-min-file-size = 110 diff --git a/.pylintrc b/.pylintrc index 04d689ffd..31e91a3d3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -30,6 +30,7 @@ disable=no-self-use, broad-except, bare-except, eval-used, + exec-used, ungrouped-imports, suppressed-message, too-many-return-statements, diff --git a/FAQ.asciidoc b/FAQ.asciidoc index 38a159473..0fe340474 100644 --- a/FAQ.asciidoc +++ b/FAQ.asciidoc @@ -193,7 +193,7 @@ Configuration not saved after modifying config.:: Unable to view flash content.:: If you have flash installed for on your system, it's necessary to enable plugins - to use the flash plugin. Using the command `:set content allow-plugins true` + to use the flash plugin. Using the command `:set content.plugins true` in qutebrowser will enable plugins. Packages for flash should be provided for your platform or it can be obtained from http://get.adobe.com/flashplayer/[Adobe]. diff --git a/MANIFEST.in b/MANIFEST.in index ec3e90473..52beeab1e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,6 +17,7 @@ include requirements.txt include tox.ini include qutebrowser.py include misc/cheatsheet.svg +include qutebrowser/config/configdata.yml prune www prune scripts/dev diff --git a/README.asciidoc b/README.asciidoc index bf6225062..c7f3ebc48 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -50,6 +50,7 @@ image:https://qutebrowser.org/img/cheatsheet-small.png["qutebrowser key binding * link:doc/quickstart.asciidoc[Quick start guide] * A https://www.shortcutfoo.com/app/dojos/qutebrowser[free training course] to remember those key bindings. * link:FAQ.asciidoc[Frequently asked questions] +* link:doc/help/configuring.html[Configuring qutebrowser] * link:CONTRIBUTING.asciidoc[Contributing to qutebrowser] * link:INSTALL.asciidoc[INSTALL] * link:CHANGELOG.asciidoc[Change Log] diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 4fca0a272..25c4c463f 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -88,7 +88,6 @@ It is possible to run or bind multiple commands by separating them with `;;`. |<>|Re-open a closed tab. |<>|Show the source of the current page in a new tab. |<>|Close all windows except for the current one. -|<>|Save open pages and quit. |<>|Yank something to the clipboard or primary selection. |<>|Set the zoom level for the current tab. |<>|Increase the zoom level for the current tab. @@ -126,7 +125,8 @@ Bind a key to a command. ==== optional arguments -* +*-m*+, +*--mode*+: A comma-separated list of modes to bind the key in (default: `normal`). +* +*-m*+, +*--mode*+: A comma-separated list of modes to bind the key in (default: `normal`). See `:help bindings.commands` for the + available modes. * +*-f*+, +*--force*+: Rebind the key if it is already bound. @@ -281,7 +281,7 @@ Syntax: +:edit-url [*--bg*] [*--tab*] [*--window*] ['url']+ Navigate to a url formed in an external editor. -The editor which should be launched can be configured via the `general -> editor` config option. +The editor which should be launched can be configured via the `editor.command` config option. ==== positional arguments * +'url'+: URL to edit; defaults to the current page url. @@ -338,7 +338,7 @@ Show help about a command or setting. * +'topic'+: The topic to show help for. - :__command__ for commands. - - __section__\->__option__ for settings. + - __section__.__option__ for settings. ==== optional arguments @@ -368,7 +368,7 @@ Start hinting. - `normal`: Open the link. - `current`: Open the link in the current tab. - `tab`: Open the link in a new tab (honoring the - background-tabs setting). + `tabs.background_tabs` setting). - `tab-fg`: Open the link in a new foreground tab. - `tab-bg`: Open the link in a new background tab. - `window`: Open the link in a new window. @@ -402,13 +402,13 @@ Start hinting. ==== optional arguments -* +*-r*+, +*--rapid*+: Whether to do rapid hinting. This is only possible with targets `tab` (with background-tabs=true), `tab-bg`, +* +*-r*+, +*--rapid*+: Whether to do rapid hinting. This is only possible with targets `tab` (with `tabs.background_tabs=true`), `tab-bg`, `window`, `run`, `hover`, `userscript` and `spawn`. * +*-m*+, +*--mode*+: The hinting mode to use. - `number`: Use numeric hints. - - `letter`: Use the chars in the hints->chars settings. + - `letter`: Use the chars in the hints.chars setting. - `word`: Use hint words based on the html elements and the extra words. @@ -545,7 +545,7 @@ For `increment` and `decrement`, the number to change the URL by. For `up`, the [[open]] === open -Syntax: +:open [*--implicit*] [*--bg*] [*--tab*] [*--window*] [*--secure*] [*--private*] +Syntax: +:open [*--related*] [*--bg*] [*--tab*] [*--window*] [*--secure*] [*--private*] ['url']+ Open a URL in the current/[count]th tab. @@ -556,7 +556,7 @@ If the URL contains newlines, each line gets opened in its own tab. * +'url'+: The URL to open. ==== optional arguments -* +*-i*+, +*--implicit*+: If opening a new tab, treat the tab as implicit (like clicking on a link). +* +*-r*+, +*--related*+: If opening a new tab, position the tab as related to the current one (like clicking on a link). * +*-b*+, +*--bg*+: Open in a new background tab. * +*-t*+, +*--tab*+: Open in a new tab. @@ -632,8 +632,17 @@ Save the current page as a quickmark. [[quit]] === quit +Syntax: +:quit [*--save*] ['session']+ + Quit qutebrowser. +==== positional arguments +* +'session'+: The name of the session to save. + +==== optional arguments +* +*-s*+, +*--save*+: When given, save the open windows even if auto_save.session is turned off. + + [[record-macro]] === record-macro Syntax: +:record-macro ['register']+ @@ -752,7 +761,7 @@ Syntax: +:session-save [*--current*] [*--quiet*] [*--force*] [*--only-active-win Save a session. ==== positional arguments -* +'name'+: The name of the session. If not given, the session configured in general -> session-default-name is saved. +* +'name'+: The name of the session. If not given, the session configured in session_default_name is saved. ==== optional arguments @@ -764,19 +773,18 @@ Save a session. [[set]] === set -Syntax: +:set [*--temp*] [*--print*] ['section'] ['option'] ['values' ['values' ...]]+ +Syntax: +:set [*--temp*] [*--print*] ['option'] ['values' ['values' ...]]+ Set an option. If the option name ends with '?', the value of the option is shown instead. If the option name ends with '!' and it is a boolean value, toggle it. ==== positional arguments -* +'section'+: The section where the option is in. * +'option'+: The name of the option. * +'values'+: The value to set, or the values to cycle through. ==== optional arguments -* +*-t*+, +*--temp*+: Set value temporarily. +* +*-t*+, +*--temp*+: Set value temporarily until qutebrowser is closed. * +*-p*+, +*--print*+: Print the value after setting. [[set-cmd-text]] @@ -843,7 +851,7 @@ Close the current/[count]th tab. ==== optional arguments * +*-p*+, +*--prev*+: Force selecting the tab before the current tab. * +*-n*+, +*--next*+: Force selecting the tab after the current tab. -* +*-o*+, +*--opposite*+: Force selecting the tab in the opposite direction of what's configured in 'tabs->select-on-remove'. +* +*-o*+, +*--opposite*+: Force selecting the tab in the opposite direction of what's configured in 'tabs.select_on_remove'. * +*-f*+, +*--force*+: Avoid confirmation for pinned tabs. @@ -911,7 +919,7 @@ Close all tabs except for the current one. === tab-pin Pin/Unpin the current/[count]th tab. -Pinning a tab shrinks it to tabs->pinned-width size. Attempting to close a pinned tab will cause a confirmation, unless --force is passed. +Pinning a tab shrinks it to `tabs.width.pinned` size. Attempting to close a pinned tab will cause a confirmation, unless --force is passed. ==== count The tab index to pin or unpin @@ -925,13 +933,15 @@ How many tabs to switch back. [[unbind]] === unbind -Syntax: +:unbind 'key' ['mode']+ +Syntax: +:unbind [*--mode* 'mode'] 'key'+ Unbind a keychain. ==== positional arguments * +'key'+: The keychain or special key (inside <...>) to unbind. -* +'mode'+: A comma-separated list of modes to unbind the key in (default: `normal`). + +==== optional arguments +* +*-m*+, +*--mode*+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes. [[undo]] @@ -946,15 +956,6 @@ Show the source of the current page in a new tab. === window-only Close all windows except for the current one. -[[wq]] -=== wq -Syntax: +:wq ['name']+ - -Save open pages and quit. - -==== positional arguments -* +'name'+: The name of the session. - [[yank]] === yank Syntax: +:yank [*--sel*] [*--keep*] ['what']+ @@ -1043,6 +1044,7 @@ How many steps to zoom out. |<>|Move the cursor or selection to the start of the line. |<>|Move the cursor or selection to the start of next block. |<>|Move the cursor or selection to the start of previous block. +|<>|Do nothing. |<>|Open an external editor with the currently selected form field. |<>|Accept the current prompt. |<>|Shift the focus of the prompt file completion menu to another item. @@ -1290,11 +1292,15 @@ Move the cursor or selection to the start of previous block. ==== count How many blocks to move. +[[nop]] +=== nop +Do nothing. + [[open-editor]] === open-editor Open an external editor with the currently selected form field. -The editor which should be launched can be configured via the `general -> editor` config option. +The editor which should be launched can be configured via the `editor.command` config option. [[prompt-accept]] === prompt-accept diff --git a/doc/help/configuring.asciidoc b/doc/help/configuring.asciidoc new file mode 100644 index 000000000..07458d77e --- /dev/null +++ b/doc/help/configuring.asciidoc @@ -0,0 +1,180 @@ +Configuring qutebrowser +======================= + +IMPORTANT: qutebrowser's configuration system was completely rewritten in +September 2017. This information is not applicable to older releases, and older +information elsewhere might be outdated. **If you had an old configuration +around and upgraded, this page will automatically open once**. To view it at a +later time, use the `:help` command. + +Migrating older configurations +------------------------------ + +qutebrowser does no automatic migration for the new configuration. However, +there's a special link:qute://configdiff[config diff page] which will show you +the changes you did in your old configuration, compared to the old defaults. + +Configuring qutebrowser via the user interface +---------------------------------------------- + +The easy (but less flexible) way to configure qutebrowser is using its user +interface or command line. Changes you make this way are immediately active +(with the exception of a few settings, where this is pointed out in the +documentation) and are persisted in an `autoconfig.yml` file. + +Using the link:commands.html#set[`:set`] command and command completion, you +can quickly set settings interactively, for example `:set tabs.position left`. + +To get more help about a setting, use e.g. `:help tabs.position`. + +If you want to customize many settings, you can open the link:qute://settings[] +page by running `:set` without any arguments, where all settings are listed and +customizable. + +To bind and unbind keys, you can use the link:commands.html#bind[`:bind`] and +link:commands.html#unbind[`:unbind`] commands: + +- Binding a key: `:bind ,v spawn mpv {url}` +- Unbinding: `:unbind ,v` +- Changing an existing binding: `bind --force ,v message-info foo` + +Key chains starting with a comma are ideal for custom bindings, as the comma key +will never be used in a default keybinding. + +The `autoconfig.yml` file is located in the "config" folder listed on the +link:qute://version[] page. On macOS, the "auto config" folder is used, which is +different from where hand-written config files are kept. + +**Do not** edit `autoconfig.yml` by hand. Instead, see the next section. + +Configuring qutebrowser via config.py +------------------------------------- + +For more powerful configuration possibilities, you can create a `config.py` +file. Since it's a Python file, you have much more flexibility for +configuration. Note that qutebrowser will never touch this file - this means +you'll be responsible for updating it when upgrading to a newer qutebrowser +version. + +The file should be located in the "config" location listed on +link:qute://version[], which is typically `~/.config/qutebrowser/config.py` on +Linux, `~/.qutebrowser/config.py` on macOS, and +`%APPDATA%/qutebrowser/config.py` on Windows. + +Two global objects are pre-defined when executing the file: `c` and `config`. + +Changing settings +~~~~~~~~~~~~~~~~~ + +`c` is a shorthand object to easily set settings like this: + +[source,python] +---- +c.tabs.position = "left" +c.completion.shrink = True +---- + +See the link:settings.html[settings help page] for all available settings. The +accepted values depend on the type of the option. Commonly used are: + +- Strings: `c.tabs.position = "left"` +- Booleans: `c.completion.shrink = True` +- Integers: `c.messages.timeout = 5000` +- Dictionaries: + * `c.headers.custom = {'X-Hello': 'World'}` to override any other values in the + dictionary. + * `c.aliases['foo'] = ':message-info foo'` to add a single value. +- Lists: + * `c.url.start_pages = ["https://www.qutebrowser.org/"]` to override any + previous elements. + * `c.url.start_pages.append("https://www.python.org/")` to add a new value. + +Any other config types (e.g. a color) are specified as a string, with the +exception of the `Regex` type which can take either a string (with an `r` prefix +to preserve backslashes) or a Python regex object: + +- `c.hints.next_regexes.append(r'\bvor\b')` +- `c.hints.prev_regexes.append(re.compile(r'\bzurück\b'))` + +If you want to read a setting, you can use the `c` object to do so as well: +`c.colors.tabs.even.bg = c.colors.tabs.odd.bg`. + + +Using strings for setting names +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want to set settings based on their name as a string, use the +`config.set` method: + +[source,python] +---- +config.set('content.javascript.enabled', False) +---- + +To read a setting, use the `config.get` method: + +[source,python] +---- +color = config.get('colors.completion.fg') +---- + +Binding keys +~~~~~~~~~~~~ + +While it's possible to change the `bindings.commands` setting to bind keys, it's +preferred to use the `config.bind` command. Doing so ensures the commands are +valid and normalizes different expressions which map to the same key. + +For details on how to specify keys and the available modes, see the +link:settings.html#bindings.commands[documentation] for the `bindings.commands` +setting. + +To bind a key: + +[source,python] +---- +config.bind(',v', 'spawn mpv {url}', mode='normal') +---- + +If the key is already bound, `force=True` needs to be given to rebind it: + +[source,python] +---- +config.bind(',v', 'message-info foo', mode='normal', force=True) +---- + +To unbind a key (either a key which has been bound before, or a default binding): + +[source,python] +---- +config.unbind(',v', mode='normal') +---- + +Key chains starting with a comma are ideal for custom bindings, as the comma key +will never be used in a default keybinding. + +To suppress loading of any default keybindings, you can set `c.bindings.defaults += {}`. + +Prevent loading `autoconfig.yml` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want all customization done via `:set`, `:bind` and `:unbind` to be +temporary, you can suppress loading `autoconfig.yml` in your `config.py` by +doing: + +[source,python] +---- +config.load_autoconfig = False +---- + +Handling errors +~~~~~~~~~~~~~~~ + +If there are errors in your `config.py`, qutebrowser will try to apply as much +of it as possible, and show an error dialog before starting. + +qutebrowser tries to display errors which are easy to understand even for people +who are not used to writing Python. If you see a config error which you find +confusing or you think qutebrowser could handle better, please +https://github.com/qutebrowser/qutebrowser/issues[open an issue]! diff --git a/doc/help/index.asciidoc b/doc/help/index.asciidoc index 183435f68..e8321f2ad 100644 --- a/doc/help/index.asciidoc +++ b/doc/help/index.asciidoc @@ -10,6 +10,7 @@ The following help pages are currently available: * link:../../FAQ.html[Frequently asked questions] * link:../../CHANGELOG.html[Change Log] * link:commands.html[Documentation of commands] +* link:configuring.html[Configuring qutebrowser] * link:settings.html[Documentation of settings] * link:../userscripts.html[How to write userscripts] * link:../../CONTRIBUTING.html[Contributing to qutebrowser] diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 92bc918e1..d66d7cccb 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -2,426 +2,1274 @@ // It is autogenerated by running: // $ python3 scripts/dev/src2asciidoc.py -= Settings += Setting reference + +== All settings -.Quick reference for section ``general'' [options="header",width="75%",cols="25%,75%"] |============== |Setting|Description -|<>|Whether to find text on a page case-insensitively. -|<>|The default page(s) to open at the start, separated by commas. -|<>|The URL parameters to strip with :yank url, separated by commas. -|<>|The default program used to open downloads. Set to an empty string to use the default internal handler. -|<>|The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. -|<>|Whether to start a search when something else than a URL is entered. -|<>|Whether to save the config automatically on quit. -|<>|How often (in milliseconds) to auto-save config/cookies/etc. -|<>|The editor (and arguments) to use for the `open-editor` command. -|<>|Encoding to use for editor. -|<>|Open new windows in private browsing mode which does not record visited pages. -|<>|Enable extra tools for Web developers. -|<>|Whether the background color and images are also drawn when the page is printed. -|<>|Whether load requests should be monitored for cross-site scripting attempts. -|<>|Default encoding to use for websites. -|<>|How to open links in an existing instance if a new one is launched. -|<>|Which window to choose when opening links as new tabs. -|<>|How to log javascript console messages. -|<>|Whether to always save the open pages. -|<>|The name of the session to save by default, or empty for the last loaded session. -|<>|The URL segments where `:navigate increment/decrement` will search for a number. +|<>|Aliases for commands. +|<>|How often (in milliseconds) to auto-save config/cookies/etc. +|<>|Always restore open sites when qutebrowser is reopened. +|<>|Keybindings mapping keys to commands in different modes. +|<>|Default keybindings. If you want to add bindings, modify `bindings.commands` instead. +|<>|This setting can be used to map keys to other keys. +|<>|Background color of the completion widget category headers. +|<>|Bottom border color of the completion widget category headers. +|<>|Top border color of the completion widget category headers. +|<>|Foreground color of completion widget category headers. +|<>|Background color of the completion widget for even rows. +|<>|Text color of the completion widget. +|<>|Background color of the selected completion item. +|<>|Bottom border color of the selected completion item. +|<>|Top border color of the completion widget category headers. +|<>|Foreground color of the selected completion item. +|<>|Foreground color of the matched text in the completion. +|<>|Background color of the completion widget for odd rows. +|<>|Color of the scrollbar in completion view +|<>|Color of the scrollbar handle in completion view. +|<>|Background color for the download bar. +|<>|Background color for downloads with errors. +|<>|Foreground color for downloads with errors. +|<>|Color gradient start for download backgrounds. +|<>|Color gradient start for download text. +|<>|Color gradient stop for download backgrounds. +|<>|Color gradient end for download text. +|<>|Color gradient interpolation system for download backgrounds. +|<>|Color gradient interpolation system for download text. +|<>|Background color for hints. +|<>|Font color for hints. +|<>|Font color for the matched part of hints. +|<>|Background color of the keyhint widget. +|<>|Text color for the keyhint widget. +|<>|Highlight color for keys to complete the current keychain. +|<>|Background color of an error message. +|<>|Border color of an error message. +|<>|Foreground color of an error message. +|<>|Background color of an info message. +|<>|Border color of an info message. +|<>|Foreground color an info message. +|<>|Background color of a warning message. +|<>|Border color of an error message. +|<>|Foreground color a warning message. +|<>|Background color for prompts. +|<>|Foreground color for prompts. +|<>|Background color for the selected item in filename prompts. +|<>|Background color of the statusbar in caret mode. +|<>|Foreground color of the statusbar in caret mode. +|<>|Background color of the statusbar in caret mode with a selection. +|<>|Foreground color of the statusbar in caret mode with a selection. +|<>|Background color of the statusbar in command mode. +|<>|Foreground color of the statusbar in command mode. +|<>|Background color of the statusbar in private browsing + command mode. +|<>|Foreground color of the statusbar in private browsing + command mode. +|<>|Background color of the statusbar in insert mode. +|<>|Foreground color of the statusbar in insert mode. +|<>|Background color of the statusbar. +|<>|Foreground color of the statusbar. +|<>|Background color of the statusbar in private browsing mode. +|<>|Foreground color of the statusbar in private browsing mode. +|<>|Background color of the progress bar. +|<>|Foreground color of the URL in the statusbar on error. +|<>|Default foreground color of the URL in the statusbar. +|<>|Foreground color of the URL in the statusbar for hovered links. +|<>|Foreground color of the URL in the statusbar on successful load (http). +|<>|Foreground color of the URL in the statusbar on successful load (https). +|<>|Foreground color of the URL in the statusbar when there's a warning. +|<>|Background color of the tab bar. +|<>|Background color of unselected even tabs. +|<>|Foreground color of unselected even tabs. +|<>|Color for the tab indicator on errors. +|<>|Color gradient start for the tab indicator. +|<>|Color gradient end for the tab indicator. +|<>|Color gradient interpolation system for the tab indicator. +|<>|Background color of unselected odd tabs. +|<>|Foreground color of unselected odd tabs. +|<>|Background color of selected even tabs. +|<>|Foreground color of selected even tabs. +|<>|Background color of selected odd tabs. +|<>|Foreground color of selected odd tabs. +|<>|Background color for webpages if unset (or empty to use the theme's color) +|<>|How many commands to save in the command history. +|<>|The height of the completion, in px or as percentage of the window. +|<>|Move on to the next part when there's only one possible completion left. +|<>|Padding of scrollbar handle in the completion window (in px). +|<>|Width of the scrollbar in the completion window (in px). +|<>|When to show the autocompletion window. +|<>|Shrink the completion to be smaller than the configured size if there are no scrollbars. +|<>|How to format timestamps (e.g. for the history completion). +|<>|How many URLs to show in the web history. +|<>|Whether quitting the application requires a confirmation. +|<>|Whether support for the HTML 5 web application cache feature is enabled. +|<>|The maximum number of pages to hold in the global memory page cache. +|<>|Size of the HTTP network cache. Null to use the default value. +|<>|Control which cookies to accept. +|<>|Store cookies. +|<>|Default encoding to use for websites. +|<>|Enable extra tools for Web developers. +|<>|Try to pre-fetch DNS entries to speed up browsing. +|<>|Expand each subframe to its contents. +|<>|Allow websites to request geolocations. +|<>|Value to send in the `Accept-Language` header. +|<>|Set custom headers for qutebrowser HTTP requests. +|<>|Value to send in the `DNT` header. +|<>|Send the Referer header. +|<>|User agent to send. Unset to send the default. +|<>|Whether host blocking is enabled. +|<>|List of URLs of lists which contain hosts to block. +|<>|List of domains that should always be loaded, despite being ad-blocked. +|<>|Enable or disable hyperlink auditing (``). +|<>|Whether images are automatically loaded in web pages. +|<>|Show javascript alerts. +|<>|Whether JavaScript can read from or write to the clipboard. +|<>|Whether JavaScript can close tabs. +|<>|Whether JavaScript can open new tabs without user interaction. +|<>|Enables or disables JavaScript. +|<>|Log levels to use for JavaScript console logging messages. +|<>|Use the standard JavaScript modal dialog for `alert()` and `confirm()` +|<>|Show javascript prompts. +|<>|Whether locally loaded documents are allowed to access other local urls. +|<>|Whether locally loaded documents are allowed to access remote urls. +|<>|Whether support for HTML 5 local storage and Web SQL is enabled. +|<>|Allow websites to record audio/video. +|<>|Location of a netrc-file for HTTP authentication. +|<>|Allow websites to show notifications. +|<>|Enable pdf.js to view PDF files in the browser. +|<>|Enables or disables plugins in Web pages. +|<>|Whether the background color and images are also drawn when the page is printed. +|<>|Open new windows in private browsing mode which does not record visited pages. +|<>|The proxy to use. +|<>|Send DNS requests over the configured proxy. +|<>|Validate SSL handshakes. +|<>|A list of user stylesheet filenames to use. +|<>|Enables or disables WebGL. +|<>|Whether load requests should be monitored for cross-site scripting attempts. +|<>|The directory to save downloads to. +|<>|Prompt the user for the download location. +|<>|Remember the last used download directory. +|<>|What to display in the download filename input. +|<>|The default program used to open downloads. +|<>|Where to show the downloaded files. +|<>|Number of milliseconds to wait before removing finished downloads. +|<>|The editor (and arguments) to use for the `open-editor` command. +|<>|Encoding to use for the editor. +|<>|Font used in the completion categories. +|<>|Font used in the completion widget. +|<>|Font used for the debugging console. +|<>|Font used for the downloadbar. +|<>|Font used for the hints. +|<>|Font used in the keyhint widget. +|<>|Font used for error messages. +|<>|Font used for info messages. +|<>|Font used for warning messages. +|<>|Default monospace fonts. +|<>|Font used for prompts. +|<>|Font used in the statusbar. +|<>|Font used in the tab bar. +|<>|Font family for cursive fonts. +|<>|Font family for fantasy fonts. +|<>|Font family for fixed fonts. +|<>|Font family for sans-serif fonts. +|<>|Font family for serif fonts. +|<>|Font family for standard fonts. +|<>|The default font size for regular text. +|<>|The default font size for fixed-pitch text. +|<>|The hard minimum font size. +|<>|The minimum logical font size that is applied when zooming out. +|<>|Controls when a hint can be automatically followed without pressing Enter. +|<>|A timeout (in milliseconds) to ignore normal-mode key bindings after a successful auto-follow. +|<>|CSS border value for hints. +|<>|Chars used for hint strings. +|<>|The dictionary file to be used by the word hints. +|<>|Which implementation to use to find elements to hint. +|<>|Hide unmatched hints in rapid mode. +|<>|Minimum number of chars used for hint strings. +|<>|Mode to use for hints. +|<>|A comma-separated list of regexes to use for 'next' links. +|<>|A comma-separated list of regexes to use for 'prev' links. +|<>|Scatter hint key chains (like Vimium) or not (like dwb). +|<>|Make chars in hint strings uppercase. +|<>|The maximum time in minutes between two history items for them to be considered being from the same browsing session. +|<>|Find text on a page case-insensitively. +|<>|Forward unbound keys to the webview in normal mode. +|<>|Leave insert mode if a non-editable element is clicked. +|<>|Automatically enter insert mode if an editable element is focused after loading the page. +|<>|Switch to insert mode when clicking flash and other plugins. +|<>|Include hyperlinks in the keyboard focus chain when tabbing. +|<>|Timeout (in milliseconds) for partially typed key bindings. +|<>|Enable Opera-like mouse rocker gestures. +|<>|Enable Spatial Navigation. +|<>|Keychains that shouldn\'t be shown in the keyhint dialog. +|<>|Time from pressing a key to seeing the keyhint dialog (ms). +|<>|Time (in ms) to show messages in the statusbar for. +|<>|Show messages in unfocused windows. +|<>|How to open links in an existing instance if a new one is launched. +|<>|Which window to choose when opening links as new tabs. +|<>|Show a filebrowser in upload/download prompts. +|<>|The rounding radius for the edges of prompts. +|<>|Show a scrollbar. +|<>|Enable smooth scrolling for web pages. +|<>|The name of the session to save by default. +|<>|Hide the statusbar unless a message is shown. +|<>|Padding for the statusbar. +|<>|The position of the status bar. +|<>|Open new tabs (middleclick/ctrl+click) in the background. +|<>|On which mouse button to close tabs. +|<>|Scaling for favicons in the tab bar. +|<>|Show favicons in the tab bar. +|<>|Padding for tab indicators +|<>|Behavior when the last tab is closed. +|<>|Switch between tabs using the mouse wheel. +|<>|How new tabs opened from another tab are positioned. +|<>|How new tabs which aren't opened from another tab are positioned. +|<>|Padding around text for tabs +|<>|The position of the tab bar. +|<>|Which tab to select when the focused tab is removed. +|<>|When to show the tab bar. +|<>|Time to show the tab bar before hiding it when tabs.show is set to 'switching'. +|<>|Open a new window for every tab. +|<>|Alignment of the text inside of tabs. +|<>|The format to use for the tab title. +|<>|The format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined. +|<>|The width of the tab bar if it's vertical, in px or as percentage of the window. +|<>|Width of the progress indicator (0 to disable). +|<>|The width for pinned tabs with a horizontal tabbar, in px. +|<>|Whether to wrap when changing tabs. +|<>|Whether to start a search when something else than a URL is entered. +|<>|The page to open if :open -t/-b/-w is used without URL. +|<>|The URL segments where `:navigate increment/decrement` will search for a number. +|<>|Definitions of search engines which can be used via the address bar. +|<>|The page(s) to open at the start. +|<>|The URL parameters to strip with `:yank url`. +|<>|Hide the window decoration when using wayland (requires restart) +|<>|The format to use for the window title. +|<>|The default zoom level. +|<>|The available zoom levels. +|<>|How much to divide the mouse wheel movements to translate them into zoom increments. +|<>|Whether the zoom factor on a frame applies only to the text or to all content. |============== -.Quick reference for section ``ui'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|The maximum time in minutes between two history items for them to be considered being from the same session. Use -1 to disable separation. -|<>|The available zoom levels, separated by commas. -|<>|The default zoom level. -|<>|Where to show the downloaded files. -|<>|The position of the status bar. -|<>|Time (in ms) to show messages in the statusbar for. -|<>|Whether to show messages in unfocused windows. -|<>|Whether to confirm quitting the application. -|<>|Whether the zoom factor on a frame applies only to the text or to all content. -|<>|Whether to expand each subframe to its contents. -|<>|User stylesheet to use (absolute filename or filename relative to the config directory). Will expand environment variables. -|<>|Hide the main scrollbar. -|<>|Whether to enable smooth scrolling for web pages. Note smooth scrolling does not work with the :scroll-px command. -|<>|Number of milliseconds to wait before removing finished downloads. Will not be removed if value is -1. -|<>|Whether to hide the statusbar unless a message is shown. -|<>|Padding for statusbar (top, bottom, left, right). -|<>|The format to use for the window title. The following placeholders are defined: -|<>|Use standard JavaScript modal dialog for alert() and confirm() -|<>|Hide the window decoration when using wayland (requires restart) -|<>|Keychains that shouldn't be shown in the keyhint dialog -|<>|Time from pressing a key to seeing the keyhint dialog (ms) -|<>|The rounding radius for the edges of prompts. -|<>|Show a filebrowser in upload/download prompts. -|============== +[[aliases]] +=== aliases +Aliases for commands. -.Quick reference for section ``network'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Value to send in the `DNT` header. -|<>|Value to send in the `accept-language` header. -|<>|Send the Referer header -|<>|User agent to send. Empty to send the default. -|<>|The proxy to use. -|<>|Whether to send DNS requests over the configured proxy. -|<>|Whether to validate SSL handshakes. -|<>|Whether to try to pre-fetch DNS entries to speed up browsing. -|<>|Set custom headers for qutebrowser HTTP requests. -|<>|Set location of a netrc-file for HTTP authentication. If empty, ~/.netrc is used. -|============== +Type: <> -.Quick reference for section ``completion'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|When to show the autocompletion window. -|<>|What to display in the download filename input. -|<>|How to format timestamps (e.g. for history) -|<>|The height of the completion, in px or as percentage of the window. -|<>|How many commands to save in the command history. -|<>|How many URLs to show in the web history. -|<>|Whether to move on to the next part when there's only one possible completion left. -|<>|Whether to shrink the completion to be smaller than the configured size if there are no scrollbars. -|<>|Width of the scrollbar in the completion window (in px). -|<>|Padding of scrollbar handle in completion window (in px). -|============== +Default: -.Quick reference for section ``input'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Timeout (in milliseconds) for ambiguous key bindings. -|<>|Timeout (in milliseconds) for partially typed key bindings. -|<>|Whether to switch to insert mode when clicking flash and other plugins. -|<>|Whether to leave insert mode if a non-editable element is clicked. -|<>|Whether to automatically enter insert mode if an editable element is focused after page load. -|<>|Whether to forward unbound keys to the webview in normal mode. -|<>|Enables or disables the Spatial Navigation feature. -|<>|Whether hyperlinks should be included in the keyboard focus chain. -|<>|Whether to enable Opera-like mouse rocker gestures. This disables the context menu. -|<>|How much to divide the mouse wheel movements to translate them into zoom increments. -|============== +- +pass:[q]+: +pass:[quit]+ +- +pass:[w]+: +pass:[session-save]+ +- +pass:[wq]+: +pass:[quit --save]+ -.Quick reference for section ``tabs'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Whether to open new tabs (middleclick/ctrl+click) in background. -|<>|Which tab to select when the focused tab is removed. -|<>|How new tabs are positioned. -|<>|How new tabs opened explicitly are positioned. -|<>|Behavior when the last tab is closed. -|<>|When to show the tab bar -|<>|Time to show the tab bar before hiding it when tabs->show is set to 'switching'. -|<>|Whether to wrap when changing tabs. -|<>|Whether tabs should be movable. -|<>|On which mouse button to close tabs. -|<>|The position of the tab bar. -|<>|Whether to show favicons in the tab bar. -|<>|Scale for favicons in the tab bar. The tab size is unchanged, so big favicons also require extra `tabs->padding`. -|<>|The width of the tab bar if it's vertical, in px or as percentage of the window. -|<>|The width for pinned tabs with a horizontal tabbar, in px. -|<>|Width of the progress indicator (0 to disable). -|<>|Whether to open windows instead of tabs. -|<>|The format to use for the tab title. The following placeholders are defined: -|<>|The format to use for the tab title for pinned tabs. The same placeholders like for title-format are defined. -|<>|Alignment of the text inside of tabs -|<>|Switch between tabs using the mouse wheel. -|<>|Padding for tabs (top, bottom, left, right). -|<>|Padding for indicators (top, bottom, left, right). -|============== - -.Quick reference for section ``storage'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|The directory to save downloads to. An empty value selects a sensible os-specific default. Will expand environment variables. -|<>|Whether to prompt the user for the download location. -|<>|Whether to remember the last used download directory. -|<>|The maximum number of pages to hold in the global memory page cache. -|<>|Whether support for the HTML 5 web application cache feature is enabled. -|<>|Whether support for HTML 5 local storage and Web SQL is enabled. -|<>|Size of the HTTP network cache. Empty to use the default value. -|============== - -.Quick reference for section ``content'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Whether images are automatically loaded in web pages. -|<>|Enables or disables the running of JavaScript programs. -|<>|Enables or disables plugins in Web pages. -|<>|Enables or disables WebGL. -|<>|Enable or disable hyperlink auditing (). -|<>|Allow websites to request geolocations. -|<>|Allow websites to show notifications. -|<>|Allow websites to record audio/video. -|<>|Whether JavaScript programs can open new windows without user interaction. -|<>|Whether JavaScript programs can close windows. -|<>|Whether JavaScript programs can read or write to the clipboard. -|<>|Whether all javascript prompts should be ignored. -|<>|Whether all javascript alerts should be ignored. -|<>|Whether locally loaded documents are allowed to access remote urls. -|<>|Whether locally loaded documents are allowed to access other local urls. -|<>|Control which cookies to accept. -|<>|Whether to store cookies. Note this option needs a restart with QtWebEngine on Qt < 5.9. -|<>|List of URLs of lists which contain hosts to block. -|<>|Whether host blocking is enabled. -|<>|List of domains that should always be loaded, despite being ad-blocked. -|<>|Enable pdf.js to view PDF files in the browser. -|============== - -.Quick reference for section ``hints'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|CSS border value for hints. -|<>|Mode to use for hints. -|<>|Chars used for hint strings. -|<>|Minimum number of chars used for hint strings. -|<>|Whether to scatter hint key chains (like Vimium) or not (like dwb). Ignored for number hints. -|<>|Make chars in hint strings uppercase. -|<>|The dictionary file to be used by the word hints. -|<>|Controls when a hint can be automatically followed without the user pressing Enter. -|<>|A timeout (in milliseconds) to inhibit normal-mode key bindings after a successful auto-follow. -|<>|A comma-separated list of regexes to use for 'next' links. -|<>|A comma-separated list of regexes to use for 'prev' links. -|<>|Which implementation to use to find elements to hint. -|<>|Controls hiding unmatched hints in rapid mode. -|============== - -.Quick reference for section ``colors'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Text color of the completion widget. -|<>|Background color of the completion widget. -|<>|Alternating background color of the completion widget. -|<>|Foreground color of completion widget category headers. -|<>|Background color of the completion widget category headers. -|<>|Top border color of the completion widget category headers. -|<>|Bottom border color of the completion widget category headers. -|<>|Foreground color of the selected completion item. -|<>|Background color of the selected completion item. -|<>|Top border color of the completion widget category headers. -|<>|Bottom border color of the selected completion item. -|<>|Foreground color of the matched text in the completion. -|<>|Color of the scrollbar handle in completion view. -|<>|Color of the scrollbar in completion view -|<>|Foreground color of the statusbar. -|<>|Background color of the statusbar. -|<>|Foreground color of the statusbar in private browsing mode. -|<>|Background color of the statusbar in private browsing mode. -|<>|Foreground color of the statusbar in insert mode. -|<>|Background color of the statusbar in insert mode. -|<>|Foreground color of the statusbar in command mode. -|<>|Background color of the statusbar in command mode. -|<>|Foreground color of the statusbar in private browsing + command mode. -|<>|Background color of the statusbar in private browsing + command mode. -|<>|Foreground color of the statusbar in caret mode. -|<>|Background color of the statusbar in caret mode. -|<>|Foreground color of the statusbar in caret mode with a selection -|<>|Background color of the statusbar in caret mode with a selection -|<>|Background color of the progress bar. -|<>|Default foreground color of the URL in the statusbar. -|<>|Foreground color of the URL in the statusbar on successful load (http). -|<>|Foreground color of the URL in the statusbar on successful load (https). -|<>|Foreground color of the URL in the statusbar on error. -|<>|Foreground color of the URL in the statusbar when there's a warning. -|<>|Foreground color of the URL in the statusbar for hovered links. -|<>|Foreground color of unselected odd tabs. -|<>|Background color of unselected odd tabs. -|<>|Foreground color of unselected even tabs. -|<>|Background color of unselected even tabs. -|<>|Foreground color of selected odd tabs. -|<>|Background color of selected odd tabs. -|<>|Foreground color of selected even tabs. -|<>|Background color of selected even tabs. -|<>|Background color of the tab bar. -|<>|Color gradient start for the tab indicator. -|<>|Color gradient end for the tab indicator. -|<>|Color for the tab indicator on errors.. -|<>|Color gradient interpolation system for the tab indicator. -|<>|Font color for hints. -|<>|Background color for hints. Note that you can use a `rgba(...)` value for transparency. -|<>|Font color for the matched part of hints. -|<>|Background color for the download bar. -|<>|Color gradient start for download text. -|<>|Color gradient start for download backgrounds. -|<>|Color gradient end for download text. -|<>|Color gradient stop for download backgrounds. -|<>|Color gradient interpolation system for download text. -|<>|Color gradient interpolation system for download backgrounds. -|<>|Foreground color for downloads with errors. -|<>|Background color for downloads with errors. -|<>|Background color for webpages if unset (or empty to use the theme's color) -|<>|Text color for the keyhint widget. -|<>|Highlight color for keys to complete the current keychain -|<>|Background color of the keyhint widget. -|<>|Foreground color of an error message. -|<>|Background color of an error message. -|<>|Border color of an error message. -|<>|Foreground color a warning message. -|<>|Background color of a warning message. -|<>|Border color of an error message. -|<>|Foreground color an info message. -|<>|Background color of an info message. -|<>|Border color of an info message. -|<>|Foreground color for prompts. -|<>|Background color for prompts. -|<>|Background color for the selected item in filename prompts. -|============== - -.Quick reference for section ``fonts'' -[options="header",width="75%",cols="25%,75%"] -|============== -|Setting|Description -|<>|Default monospace fonts. -|<>|Font used in the completion widget. -|<>|Font used in the completion categories. -|<>|Font used in the tab bar. -|<>|Font used in the statusbar. -|<>|Font used for the downloadbar. -|<>|Font used for the hints. -|<>|Font used for the debugging console. -|<>|Font family for standard fonts. -|<>|Font family for fixed fonts. -|<>|Font family for serif fonts. -|<>|Font family for sans-serif fonts. -|<>|Font family for cursive fonts. -|<>|Font family for fantasy fonts. -|<>|The hard minimum font size. -|<>|The minimum logical font size that is applied when zooming out. -|<>|The default font size for regular text. -|<>|The default font size for fixed-pitch text. -|<>|Font used in the keyhint widget. -|<>|Font used for error messages. -|<>|Font used for warning messages. -|<>|Font used for info messages. -|<>|Font used for prompts. -|============== - -== general -General/miscellaneous options. - -[[general-ignore-case]] -=== ignore-case -Whether to find text on a page case-insensitively. - -Valid values: - - * +true+: Search case-insensitively - * +false+: Search case-sensitively - * +smart+: Search case-sensitively if there are capital chars - -Default: +pass:[smart]+ - -[[general-startpage]] -=== startpage -The default page(s) to open at the start, separated by commas. - -Default: +pass:[https://start.duckduckgo.com]+ - -[[general-yank-ignored-url-parameters]] -=== yank-ignored-url-parameters -The URL parameters to strip with :yank url, separated by commas. - -Default: +pass:[ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content]+ - -[[general-default-open-dispatcher]] -=== default-open-dispatcher -The default program used to open downloads. Set to an empty string to use the default internal handler. - -Any {} in the string will be expanded to the filename, else the filename will be appended. - -Default: empty - -[[general-default-page]] -=== default-page -The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. - -Default: +pass:[${startpage}]+ - -[[general-auto-search]] -=== auto-search -Whether to start a search when something else than a URL is entered. - -Valid values: - - * +naive+: Use simple/naive check. - * +dns+: Use DNS requests (might be slow!). - * +false+: Never search automatically. - -Default: +pass:[naive]+ - -[[general-auto-save-config]] -=== auto-save-config -Whether to save the config automatically on quit. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[general-auto-save-interval]] -=== auto-save-interval +[[auto_save.interval]] +=== auto_save.interval How often (in milliseconds) to auto-save config/cookies/etc. +Type: <> + Default: +pass:[15000]+ -[[general-editor]] -=== editor -The editor (and arguments) to use for the `open-editor` command. +[[auto_save.session]] +=== auto_save.session +Always restore open sites when qutebrowser is reopened. -The arguments get split like in a shell, so you can use `"` or `'` to quote them. -`{}` gets replaced by the filename of the file to be edited. - -Default: +pass:[gvim -f "{}"]+ - -[[general-editor-encoding]] -=== editor-encoding -Encoding to use for editor. - -Default: +pass:[utf-8]+ - -[[general-private-browsing]] -=== private-browsing -Open new windows in private browsing mode which does not record visited pages. +Type: <> Valid values: * +true+ * +false+ -Default: +pass:[false]+ +Default: empty -[[general-developer-extras]] -=== developer-extras -Enable extra tools for Web developers. +[[bindings.commands]] +=== bindings.commands +Keybindings mapping keys to commands in different modes. +This setting is a dictionary containing mode names and dictionaries mapping keys to commands: +`{mode: {key: command}}` +If you want to map a key to another key, check the `bindings.key_mappings` setting instead. +For special keys (can't be part of a keychain), enclose them in `<`...`>`. For modifiers, you can use either `-` or `+` as delimiters, and these names: -This needs to be enabled for `:inspector` to work and also adds an _Inspect_ entry to the context menu. For QtWebEngine, see 'qutebrowser --help' instead. + * Control: `Control`, `Ctrl` + + * Meta: `Meta`, `Windows`, `Mod4` + + * Alt: `Alt`, `Mod1` + + * Shift: `Shift` + +For simple keys (no `<>`-signs), a capital letter means the key is pressed with Shift. For special keys (with `<>`-signs), you need to explicitly add `Shift-` to match a key pressed with shift. +If you want a binding to do nothing, bind it to the `nop` command. If you want a default binding to be passed through to the website, bind it to null. +Note that some commands which are only useful for bindings (but not used interactively) are hidden from the command completion. See `:help` for a full list of available commands. +The following modes are available: + +* normal: The default mode, where most commands are invoked. + +* insert: Entered when an input field is focused on a website, or by + pressing `i` in normal mode. Passes through almost all keypresses to the + website, but has some bindings like `` to open an external editor. + Note that single keys can't be bound in this mode. + +* hint: Entered when `f` is pressed to select links with the keyboard. Note + that single keys can't be bound in this mode. + +* passthrough: Similar to insert mode, but passes through all keypresses + except `` to leave the mode. It might be useful to bind `` + to some other key in this mode if you want to be able to send an Escape + key to the website as well. Note that single keys can't be bound in this + mode. + +* command: Entered when pressing the `:` key in order to enter a command. + Note that single keys can't be bound in this mode. + +* prompt: Entered when there's a prompt to display, like for download + locations or when invoked from JavaScript. + + + You can bind normal keys in this mode, but they will be only active when a + yes/no-prompt is asked. For other prompt modes, you can only bind special + keys. + +* caret: Entered when pressing the `v` mode, used to select text using the + keyboard. + +* register: Entered when qutebrowser is waiting for a register name/key for + commands like `:set-mark`. + +Type: <> + +Default: empty + +[[bindings.default]] +=== bindings.default +Default keybindings. If you want to add bindings, modify `bindings.commands` instead. +The main purpose of this setting is that you can set it to an empty dictionary if you want to load no default keybindings at all. +If you want to preserve default bindings (and get new bindings when there is an update), add new bindings to `bindings.commands` (or use `:bind`) and leave this setting alone. + +Type: <> + +Default: + +- +pass:[caret]+: + +* +pass:[$]+: +pass:[move-to-end-of-line]+ +* +pass:[0]+: +pass:[move-to-start-of-line]+ +* +pass:[<Ctrl-Space>]+: +pass:[drop-selection]+ +* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Return>]+: +pass:[yank selection]+ +* +pass:[<Space>]+: +pass:[toggle-selection]+ +* +pass:[G]+: +pass:[move-to-end-of-document]+ +* +pass:[H]+: +pass:[scroll left]+ +* +pass:[J]+: +pass:[scroll down]+ +* +pass:[K]+: +pass:[scroll up]+ +* +pass:[L]+: +pass:[scroll right]+ +* +pass:[Y]+: +pass:[yank selection -s]+ +* +pass:[[]+: +pass:[move-to-start-of-prev-block]+ +* +pass:[]]+: +pass:[move-to-start-of-next-block]+ +* +pass:[b]+: +pass:[move-to-prev-word]+ +* +pass:[c]+: +pass:[enter-mode normal]+ +* +pass:[e]+: +pass:[move-to-end-of-word]+ +* +pass:[gg]+: +pass:[move-to-start-of-document]+ +* +pass:[h]+: +pass:[move-to-prev-char]+ +* +pass:[j]+: +pass:[move-to-next-line]+ +* +pass:[k]+: +pass:[move-to-prev-line]+ +* +pass:[l]+: +pass:[move-to-next-char]+ +* +pass:[v]+: +pass:[toggle-selection]+ +* +pass:[w]+: +pass:[move-to-next-word]+ +* +pass:[y]+: +pass:[yank selection]+ +* +pass:[{]+: +pass:[move-to-end-of-prev-block]+ +* +pass:[}]+: +pass:[move-to-end-of-next-block]+ +- +pass:[command]+: + +* +pass:[<Alt-B>]+: +pass:[rl-backward-word]+ +* +pass:[<Alt-Backspace>]+: +pass:[rl-backward-kill-word]+ +* +pass:[<Alt-D>]+: +pass:[rl-kill-word]+ +* +pass:[<Alt-F>]+: +pass:[rl-forward-word]+ +* +pass:[<Ctrl-?>]+: +pass:[rl-delete-char]+ +* +pass:[<Ctrl-A>]+: +pass:[rl-beginning-of-line]+ +* +pass:[<Ctrl-B>]+: +pass:[rl-backward-char]+ +* +pass:[<Ctrl-D>]+: +pass:[completion-item-del]+ +* +pass:[<Ctrl-E>]+: +pass:[rl-end-of-line]+ +* +pass:[<Ctrl-F>]+: +pass:[rl-forward-char]+ +* +pass:[<Ctrl-H>]+: +pass:[rl-backward-delete-char]+ +* +pass:[<Ctrl-K>]+: +pass:[rl-kill-line]+ +* +pass:[<Ctrl-N>]+: +pass:[command-history-next]+ +* +pass:[<Ctrl-P>]+: +pass:[command-history-prev]+ +* +pass:[<Ctrl-Shift-Tab>]+: +pass:[completion-item-focus prev-category]+ +* +pass:[<Ctrl-Tab>]+: +pass:[completion-item-focus next-category]+ +* +pass:[<Ctrl-U>]+: +pass:[rl-unix-line-discard]+ +* +pass:[<Ctrl-W>]+: +pass:[rl-unix-word-rubout]+ +* +pass:[<Ctrl-Y>]+: +pass:[rl-yank]+ +* +pass:[<Down>]+: +pass:[command-history-next]+ +* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Return>]+: +pass:[command-accept]+ +* +pass:[<Shift-Delete>]+: +pass:[completion-item-del]+ +* +pass:[<Shift-Tab>]+: +pass:[completion-item-focus prev]+ +* +pass:[<Tab>]+: +pass:[completion-item-focus next]+ +* +pass:[<Up>]+: +pass:[command-history-prev]+ +- +pass:[hint]+: + +* +pass:[<Ctrl-B>]+: +pass:[hint all tab-bg]+ +* +pass:[<Ctrl-F>]+: +pass:[hint links]+ +* +pass:[<Ctrl-R>]+: +pass:[hint --rapid links tab-bg]+ +* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Return>]+: +pass:[follow-hint]+ +- +pass:[insert]+: + +* +pass:[<Ctrl-E>]+: +pass:[open-editor]+ +* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Shift-Ins>]+: +pass:[insert-text {primary}]+ +- +pass:[normal]+: + +* +pass:[']+: +pass:[enter-mode jump_mark]+ +* +pass:[+]+: +pass:[zoom-in]+ +* +pass:[-]+: +pass:[zoom-out]+ +* +pass:[.]+: +pass:[repeat-command]+ +* +pass:[/]+: +pass:[set-cmd-text /]+ +* +pass:[:]+: +pass:[set-cmd-text :]+ +* +pass:[;I]+: +pass:[hint images tab]+ +* +pass:[;O]+: +pass:[hint links fill :open -t -r {hint-url}]+ +* +pass:[;R]+: +pass:[hint --rapid links window]+ +* +pass:[;Y]+: +pass:[hint links yank-primary]+ +* +pass:[;b]+: +pass:[hint all tab-bg]+ +* +pass:[;d]+: +pass:[hint links download]+ +* +pass:[;f]+: +pass:[hint all tab-fg]+ +* +pass:[;h]+: +pass:[hint all hover]+ +* +pass:[;i]+: +pass:[hint images]+ +* +pass:[;o]+: +pass:[hint links fill :open {hint-url}]+ +* +pass:[;r]+: +pass:[hint --rapid links tab-bg]+ +* +pass:[;t]+: +pass:[hint inputs]+ +* +pass:[;y]+: +pass:[hint links yank]+ +* +pass:[<Alt-1>]+: +pass:[tab-focus 1]+ +* +pass:[<Alt-2>]+: +pass:[tab-focus 2]+ +* +pass:[<Alt-3>]+: +pass:[tab-focus 3]+ +* +pass:[<Alt-4>]+: +pass:[tab-focus 4]+ +* +pass:[<Alt-5>]+: +pass:[tab-focus 5]+ +* +pass:[<Alt-6>]+: +pass:[tab-focus 6]+ +* +pass:[<Alt-7>]+: +pass:[tab-focus 7]+ +* +pass:[<Alt-8>]+: +pass:[tab-focus 8]+ +* +pass:[<Alt-9>]+: +pass:[tab-focus -1]+ +* +pass:[<Ctrl-A>]+: +pass:[navigate increment]+ +* +pass:[<Ctrl-Alt-p>]+: +pass:[print]+ +* +pass:[<Ctrl-B>]+: +pass:[scroll-page 0 -1]+ +* +pass:[<Ctrl-D>]+: +pass:[scroll-page 0 0.5]+ +* +pass:[<Ctrl-F5>]+: +pass:[reload -f]+ +* +pass:[<Ctrl-F>]+: +pass:[scroll-page 0 1]+ +* +pass:[<Ctrl-N>]+: +pass:[open -w]+ +* +pass:[<Ctrl-PgDown>]+: +pass:[tab-next]+ +* +pass:[<Ctrl-PgUp>]+: +pass:[tab-prev]+ +* +pass:[<Ctrl-Q>]+: +pass:[quit]+ +* +pass:[<Ctrl-Return>]+: +pass:[follow-selected -t]+ +* +pass:[<Ctrl-Shift-T>]+: +pass:[undo]+ +* +pass:[<Ctrl-T>]+: +pass:[open -t]+ +* +pass:[<Ctrl-Tab>]+: +pass:[tab-focus last]+ +* +pass:[<Ctrl-U>]+: +pass:[scroll-page 0 -0.5]+ +* +pass:[<Ctrl-V>]+: +pass:[enter-mode passthrough]+ +* +pass:[<Ctrl-W>]+: +pass:[tab-close]+ +* +pass:[<Ctrl-X>]+: +pass:[navigate decrement]+ +* +pass:[<Ctrl-^>]+: +pass:[tab-focus last]+ +* +pass:[<Ctrl-h>]+: +pass:[home]+ +* +pass:[<Ctrl-p>]+: +pass:[tab-pin]+ +* +pass:[<Ctrl-s>]+: +pass:[stop]+ +* +pass:[<Escape>]+: +pass:[clear-keychain ;; search ;; fullscreen --leave]+ +* +pass:[<F11>]+: +pass:[fullscreen]+ +* +pass:[<F5>]+: +pass:[reload]+ +* +pass:[<Return>]+: +pass:[follow-selected]+ +* +pass:[<back>]+: +pass:[back]+ +* +pass:[<forward>]+: +pass:[forward]+ +* +pass:[=]+: +pass:[zoom]+ +* +pass:[?]+: +pass:[set-cmd-text ?]+ +* +pass:[@]+: +pass:[run-macro]+ +* +pass:[B]+: +pass:[set-cmd-text -s :quickmark-load -t]+ +* +pass:[D]+: +pass:[tab-close -o]+ +* +pass:[F]+: +pass:[hint all tab]+ +* +pass:[G]+: +pass:[scroll-perc]+ +* +pass:[H]+: +pass:[back]+ +* +pass:[J]+: +pass:[tab-next]+ +* +pass:[K]+: +pass:[tab-prev]+ +* +pass:[L]+: +pass:[forward]+ +* +pass:[M]+: +pass:[bookmark-add]+ +* +pass:[N]+: +pass:[search-prev]+ +* +pass:[O]+: +pass:[set-cmd-text -s :open -t]+ +* +pass:[PP]+: +pass:[open -t -- {primary}]+ +* +pass:[Pp]+: +pass:[open -t -- {clipboard}]+ +* +pass:[R]+: +pass:[reload -f]+ +* +pass:[Ss]+: +pass:[open qute://settings]+ +* +pass:[T]+: +pass:[tab-focus]+ +* +pass:[ZQ]+: +pass:[quit]+ +* +pass:[ZZ]+: +pass:[quit --save]+ +* +pass:[[[]+: +pass:[navigate prev]+ +* +pass:[]]]+: +pass:[navigate next]+ +* +pass:[`]+: +pass:[enter-mode set_mark]+ +* +pass:[ad]+: +pass:[download-cancel]+ +* +pass:[b]+: +pass:[set-cmd-text -s :quickmark-load]+ +* +pass:[cd]+: +pass:[download-clear]+ +* +pass:[co]+: +pass:[tab-only]+ +* +pass:[d]+: +pass:[tab-close]+ +* +pass:[f]+: +pass:[hint]+ +* +pass:[g$]+: +pass:[tab-focus -1]+ +* +pass:[g0]+: +pass:[tab-focus 1]+ +* +pass:[gB]+: +pass:[set-cmd-text -s :bookmark-load -t]+ +* +pass:[gC]+: +pass:[tab-clone]+ +* +pass:[gO]+: +pass:[set-cmd-text :open -t -r {url:pretty}]+ +* +pass:[gU]+: +pass:[navigate up -t]+ +* +pass:[g^]+: +pass:[tab-focus 1]+ +* +pass:[ga]+: +pass:[open -t]+ +* +pass:[gb]+: +pass:[set-cmd-text -s :bookmark-load]+ +* +pass:[gd]+: +pass:[download]+ +* +pass:[gf]+: +pass:[view-source]+ +* +pass:[gg]+: +pass:[scroll-perc 0]+ +* +pass:[gl]+: +pass:[tab-move -]+ +* +pass:[gm]+: +pass:[tab-move]+ +* +pass:[go]+: +pass:[set-cmd-text :open {url:pretty}]+ +* +pass:[gr]+: +pass:[tab-move +]+ +* +pass:[gt]+: +pass:[set-cmd-text -s :buffer]+ +* +pass:[gu]+: +pass:[navigate up]+ +* +pass:[h]+: +pass:[scroll left]+ +* +pass:[i]+: +pass:[enter-mode insert]+ +* +pass:[j]+: +pass:[scroll down]+ +* +pass:[k]+: +pass:[scroll up]+ +* +pass:[l]+: +pass:[scroll right]+ +* +pass:[m]+: +pass:[quickmark-save]+ +* +pass:[n]+: +pass:[search-next]+ +* +pass:[o]+: +pass:[set-cmd-text -s :open]+ +* +pass:[pP]+: +pass:[open -- {primary}]+ +* +pass:[pp]+: +pass:[open -- {clipboard}]+ +* +pass:[q]+: +pass:[record-macro]+ +* +pass:[r]+: +pass:[reload]+ +* +pass:[sf]+: +pass:[save]+ +* +pass:[sk]+: +pass:[set-cmd-text -s :bind]+ +* +pass:[sl]+: +pass:[set-cmd-text -s :set -t]+ +* +pass:[ss]+: +pass:[set-cmd-text -s :set]+ +* +pass:[th]+: +pass:[back -t]+ +* +pass:[tl]+: +pass:[forward -t]+ +* +pass:[u]+: +pass:[undo]+ +* +pass:[v]+: +pass:[enter-mode caret]+ +* +pass:[wB]+: +pass:[set-cmd-text -s :bookmark-load -w]+ +* +pass:[wO]+: +pass:[set-cmd-text :open -w {url:pretty}]+ +* +pass:[wP]+: +pass:[open -w -- {primary}]+ +* +pass:[wb]+: +pass:[set-cmd-text -s :quickmark-load -w]+ +* +pass:[wf]+: +pass:[hint all window]+ +* +pass:[wh]+: +pass:[back -w]+ +* +pass:[wi]+: +pass:[inspector]+ +* +pass:[wl]+: +pass:[forward -w]+ +* +pass:[wo]+: +pass:[set-cmd-text -s :open -w]+ +* +pass:[wp]+: +pass:[open -w -- {clipboard}]+ +* +pass:[xO]+: +pass:[set-cmd-text :open -b -r {url:pretty}]+ +* +pass:[xo]+: +pass:[set-cmd-text -s :open -b]+ +* +pass:[yD]+: +pass:[yank domain -s]+ +* +pass:[yP]+: +pass:[yank pretty-url -s]+ +* +pass:[yT]+: +pass:[yank title -s]+ +* +pass:[yY]+: +pass:[yank -s]+ +* +pass:[yd]+: +pass:[yank domain]+ +* +pass:[yp]+: +pass:[yank pretty-url]+ +* +pass:[yt]+: +pass:[yank title]+ +* +pass:[yy]+: +pass:[yank]+ +* +pass:[{{]+: +pass:[navigate prev -t]+ +* +pass:[}}]+: +pass:[navigate next -t]+ +- +pass:[passthrough]+: + +* +pass:[<Ctrl-V>]+: +pass:[leave-mode]+ +- +pass:[prompt]+: + +* +pass:[<Alt-B>]+: +pass:[rl-backward-word]+ +* +pass:[<Alt-Backspace>]+: +pass:[rl-backward-kill-word]+ +* +pass:[<Alt-D>]+: +pass:[rl-kill-word]+ +* +pass:[<Alt-F>]+: +pass:[rl-forward-word]+ +* +pass:[<Ctrl-?>]+: +pass:[rl-delete-char]+ +* +pass:[<Ctrl-A>]+: +pass:[rl-beginning-of-line]+ +* +pass:[<Ctrl-B>]+: +pass:[rl-backward-char]+ +* +pass:[<Ctrl-E>]+: +pass:[rl-end-of-line]+ +* +pass:[<Ctrl-F>]+: +pass:[rl-forward-char]+ +* +pass:[<Ctrl-H>]+: +pass:[rl-backward-delete-char]+ +* +pass:[<Ctrl-K>]+: +pass:[rl-kill-line]+ +* +pass:[<Ctrl-U>]+: +pass:[rl-unix-line-discard]+ +* +pass:[<Ctrl-W>]+: +pass:[rl-unix-word-rubout]+ +* +pass:[<Ctrl-X>]+: +pass:[prompt-open-download]+ +* +pass:[<Ctrl-Y>]+: +pass:[rl-yank]+ +* +pass:[<Down>]+: +pass:[prompt-item-focus next]+ +* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Return>]+: +pass:[prompt-accept]+ +* +pass:[<Shift-Tab>]+: +pass:[prompt-item-focus prev]+ +* +pass:[<Tab>]+: +pass:[prompt-item-focus next]+ +* +pass:[<Up>]+: +pass:[prompt-item-focus prev]+ +* +pass:[n]+: +pass:[prompt-accept no]+ +* +pass:[y]+: +pass:[prompt-accept yes]+ +- +pass:[register]+: + +* +pass:[<Escape>]+: +pass:[leave-mode]+ + +[[bindings.key_mappings]] +=== bindings.key_mappings +This setting can be used to map keys to other keys. +When the key used as dictionary-key is pressed, the binding for the key used as dictionary-value is invoked instead. +This is useful for global remappings of keys, for example to map Ctrl-[ to Escape. + +Type: <> + +Default: + +- +pass:[<Ctrl-6>]+: +pass:[<Ctrl-^>]+ +- +pass:[<Ctrl-Enter>]+: +pass:[<Ctrl-Return>]+ +- +pass:[<Ctrl-J>]+: +pass:[<Return>]+ +- +pass:[<Ctrl-M>]+: +pass:[<Return>]+ +- +pass:[<Ctrl-[>]+: +pass:[<Escape>]+ +- +pass:[<Enter>]+: +pass:[<Return>]+ +- +pass:[<Shift-Enter>]+: +pass:[<Return>]+ +- +pass:[<Shift-Return>]+: +pass:[<Return>]+ + +[[colors.completion.category.bg]] +=== colors.completion.category.bg +Background color of the completion widget category headers. + +Type: <> + +Default: +pass:[qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)]+ + +[[colors.completion.category.border.bottom]] +=== colors.completion.category.border.bottom +Bottom border color of the completion widget category headers. + +Type: <> + +Default: +pass:[black]+ + +[[colors.completion.category.border.top]] +=== colors.completion.category.border.top +Top border color of the completion widget category headers. + +Type: <> + +Default: +pass:[black]+ + +[[colors.completion.category.fg]] +=== colors.completion.category.fg +Foreground color of completion widget category headers. + +Type: <> + +Default: +pass:[white]+ + +[[colors.completion.even.bg]] +=== colors.completion.even.bg +Background color of the completion widget for even rows. + +Type: <> + +Default: +pass:[#333333]+ + +[[colors.completion.fg]] +=== colors.completion.fg +Text color of the completion widget. + +Type: <> + +Default: +pass:[white]+ + +[[colors.completion.item.selected.bg]] +=== colors.completion.item.selected.bg +Background color of the selected completion item. + +Type: <> + +Default: +pass:[#e8c000]+ + +[[colors.completion.item.selected.border.bottom]] +=== colors.completion.item.selected.border.bottom +Bottom border color of the selected completion item. + +Type: <> + +Default: +pass:[#bbbb00]+ + +[[colors.completion.item.selected.border.top]] +=== colors.completion.item.selected.border.top +Top border color of the completion widget category headers. + +Type: <> + +Default: +pass:[#bbbb00]+ + +[[colors.completion.item.selected.fg]] +=== colors.completion.item.selected.fg +Foreground color of the selected completion item. + +Type: <> + +Default: +pass:[black]+ + +[[colors.completion.match.fg]] +=== colors.completion.match.fg +Foreground color of the matched text in the completion. + +Type: <> + +Default: +pass:[#ff4444]+ + +[[colors.completion.odd.bg]] +=== colors.completion.odd.bg +Background color of the completion widget for odd rows. + +Type: <> + +Default: +pass:[#444444]+ + +[[colors.completion.scrollbar.bg]] +=== colors.completion.scrollbar.bg +Color of the scrollbar in completion view + +Type: <> + +Default: +pass:[#333333]+ + +[[colors.completion.scrollbar.fg]] +=== colors.completion.scrollbar.fg +Color of the scrollbar handle in completion view. + +Type: <> + +Default: +pass:[white]+ + +[[colors.downloads.bar.bg]] +=== colors.downloads.bar.bg +Background color for the download bar. + +Type: <> + +Default: +pass:[black]+ + +[[colors.downloads.error.bg]] +=== colors.downloads.error.bg +Background color for downloads with errors. + +Type: <> + +Default: +pass:[red]+ + +[[colors.downloads.error.fg]] +=== colors.downloads.error.fg +Foreground color for downloads with errors. + +Type: <> + +Default: +pass:[white]+ + +[[colors.downloads.start.bg]] +=== colors.downloads.start.bg +Color gradient start for download backgrounds. + +Type: <> + +Default: +pass:[#0000aa]+ + +[[colors.downloads.start.fg]] +=== colors.downloads.start.fg +Color gradient start for download text. + +Type: <> + +Default: +pass:[white]+ + +[[colors.downloads.stop.bg]] +=== colors.downloads.stop.bg +Color gradient stop for download backgrounds. + +Type: <> + +Default: +pass:[#00aa00]+ + +[[colors.downloads.stop.fg]] +=== colors.downloads.stop.fg +Color gradient end for download text. + +Type: <> + +Default: +pass:[white]+ + +[[colors.downloads.system.bg]] +=== colors.downloads.system.bg +Color gradient interpolation system for download backgrounds. + +Type: <> Valid values: - * +true+ - * +false+ + * +rgb+: Interpolate in the RGB color system. + * +hsv+: Interpolate in the HSV color system. + * +hsl+: Interpolate in the HSL color system. + * +none+: Don't show a gradient. -Default: +pass:[false]+ +Default: +pass:[rgb]+ -This setting is only available with the QtWebKit backend. +[[colors.downloads.system.fg]] +=== colors.downloads.system.fg +Color gradient interpolation system for download text. -[[general-print-element-backgrounds]] -=== print-element-backgrounds -Whether the background color and images are also drawn when the page is printed. -This setting only works with Qt 5.8 or newer when using the QtWebEngine backend. +Type: <> + +Valid values: + + * +rgb+: Interpolate in the RGB color system. + * +hsv+: Interpolate in the HSV color system. + * +hsl+: Interpolate in the HSL color system. + * +none+: Don't show a gradient. + +Default: +pass:[rgb]+ + +[[colors.hints.bg]] +=== colors.hints.bg +Background color for hints. +Note that you can use a `rgba(...)` value for transparency. + +Type: <> + +Default: +pass:[qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8))]+ + +[[colors.hints.fg]] +=== colors.hints.fg +Font color for hints. + +Type: <> + +Default: +pass:[black]+ + +[[colors.hints.match.fg]] +=== colors.hints.match.fg +Font color for the matched part of hints. + +Type: <> + +Default: +pass:[green]+ + +[[colors.keyhint.bg]] +=== colors.keyhint.bg +Background color of the keyhint widget. + +Type: <> + +Default: +pass:[rgba(0, 0, 0, 80%)]+ + +[[colors.keyhint.fg]] +=== colors.keyhint.fg +Text color for the keyhint widget. + +Type: <> + +Default: +pass:[#FFFFFF]+ + +[[colors.keyhint.suffix.fg]] +=== colors.keyhint.suffix.fg +Highlight color for keys to complete the current keychain. + +Type: <> + +Default: +pass:[#FFFF00]+ + +[[colors.messages.error.bg]] +=== colors.messages.error.bg +Background color of an error message. + +Type: <> + +Default: +pass:[red]+ + +[[colors.messages.error.border]] +=== colors.messages.error.border +Border color of an error message. + +Type: <> + +Default: +pass:[#bb0000]+ + +[[colors.messages.error.fg]] +=== colors.messages.error.fg +Foreground color of an error message. + +Type: <> + +Default: +pass:[white]+ + +[[colors.messages.info.bg]] +=== colors.messages.info.bg +Background color of an info message. + +Type: <> + +Default: +pass:[black]+ + +[[colors.messages.info.border]] +=== colors.messages.info.border +Border color of an info message. + +Type: <> + +Default: +pass:[#333333]+ + +[[colors.messages.info.fg]] +=== colors.messages.info.fg +Foreground color an info message. + +Type: <> + +Default: +pass:[white]+ + +[[colors.messages.warning.bg]] +=== colors.messages.warning.bg +Background color of a warning message. + +Type: <> + +Default: +pass:[darkorange]+ + +[[colors.messages.warning.border]] +=== colors.messages.warning.border +Border color of an error message. + +Type: <> + +Default: +pass:[#d47300]+ + +[[colors.messages.warning.fg]] +=== colors.messages.warning.fg +Foreground color a warning message. + +Type: <> + +Default: +pass:[white]+ + +[[colors.prompts.bg]] +=== colors.prompts.bg +Background color for prompts. + +Type: <> + +Default: +pass:[darkblue]+ + +[[colors.prompts.fg]] +=== colors.prompts.fg +Foreground color for prompts. + +Type: <> + +Default: +pass:[white]+ + +[[colors.prompts.selected.bg]] +=== colors.prompts.selected.bg +Background color for the selected item in filename prompts. + +Type: <> + +Default: +pass:[#308cc6]+ + +[[colors.statusbar.caret.bg]] +=== colors.statusbar.caret.bg +Background color of the statusbar in caret mode. + +Type: <> + +Default: +pass:[purple]+ + +[[colors.statusbar.caret.fg]] +=== colors.statusbar.caret.fg +Foreground color of the statusbar in caret mode. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.caret.selection.bg]] +=== colors.statusbar.caret.selection.bg +Background color of the statusbar in caret mode with a selection. + +Type: <> + +Default: +pass:[#a12dff]+ + +[[colors.statusbar.caret.selection.fg]] +=== colors.statusbar.caret.selection.fg +Foreground color of the statusbar in caret mode with a selection. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.command.bg]] +=== colors.statusbar.command.bg +Background color of the statusbar in command mode. + +Type: <> + +Default: +pass:[black]+ + +[[colors.statusbar.command.fg]] +=== colors.statusbar.command.fg +Foreground color of the statusbar in command mode. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.command.private.bg]] +=== colors.statusbar.command.private.bg +Background color of the statusbar in private browsing + command mode. + +Type: <> + +Default: +pass:[grey]+ + +[[colors.statusbar.command.private.fg]] +=== colors.statusbar.command.private.fg +Foreground color of the statusbar in private browsing + command mode. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.insert.bg]] +=== colors.statusbar.insert.bg +Background color of the statusbar in insert mode. + +Type: <> + +Default: +pass:[darkgreen]+ + +[[colors.statusbar.insert.fg]] +=== colors.statusbar.insert.fg +Foreground color of the statusbar in insert mode. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.normal.bg]] +=== colors.statusbar.normal.bg +Background color of the statusbar. + +Type: <> + +Default: +pass:[black]+ + +[[colors.statusbar.normal.fg]] +=== colors.statusbar.normal.fg +Foreground color of the statusbar. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.private.bg]] +=== colors.statusbar.private.bg +Background color of the statusbar in private browsing mode. + +Type: <> + +Default: +pass:[#666666]+ + +[[colors.statusbar.private.fg]] +=== colors.statusbar.private.fg +Foreground color of the statusbar in private browsing mode. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.progress.bg]] +=== colors.statusbar.progress.bg +Background color of the progress bar. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.url.error.fg]] +=== colors.statusbar.url.error.fg +Foreground color of the URL in the statusbar on error. + +Type: <> + +Default: +pass:[orange]+ + +[[colors.statusbar.url.fg]] +=== colors.statusbar.url.fg +Default foreground color of the URL in the statusbar. + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.url.hover.fg]] +=== colors.statusbar.url.hover.fg +Foreground color of the URL in the statusbar for hovered links. + +Type: <> + +Default: +pass:[aqua]+ + +[[colors.statusbar.url.success.http.fg]] +=== colors.statusbar.url.success.http.fg +Foreground color of the URL in the statusbar on successful load (http). + +Type: <> + +Default: +pass:[white]+ + +[[colors.statusbar.url.success.https.fg]] +=== colors.statusbar.url.success.https.fg +Foreground color of the URL in the statusbar on successful load (https). + +Type: <> + +Default: +pass:[lime]+ + +[[colors.statusbar.url.warn.fg]] +=== colors.statusbar.url.warn.fg +Foreground color of the URL in the statusbar when there's a warning. + +Type: <> + +Default: +pass:[yellow]+ + +[[colors.tabs.bar.bg]] +=== colors.tabs.bar.bg +Background color of the tab bar. + +Type: <> + +Default: +pass:[#555555]+ + +[[colors.tabs.even.bg]] +=== colors.tabs.even.bg +Background color of unselected even tabs. + +Type: <> + +Default: +pass:[darkgrey]+ + +[[colors.tabs.even.fg]] +=== colors.tabs.even.fg +Foreground color of unselected even tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.indicator.error]] +=== colors.tabs.indicator.error +Color for the tab indicator on errors. + +Type: <> + +Default: +pass:[#ff0000]+ + +[[colors.tabs.indicator.start]] +=== colors.tabs.indicator.start +Color gradient start for the tab indicator. + +Type: <> + +Default: +pass:[#0000aa]+ + +[[colors.tabs.indicator.stop]] +=== colors.tabs.indicator.stop +Color gradient end for the tab indicator. + +Type: <> + +Default: +pass:[#00aa00]+ + +[[colors.tabs.indicator.system]] +=== colors.tabs.indicator.system +Color gradient interpolation system for the tab indicator. + +Type: <> + +Valid values: + + * +rgb+: Interpolate in the RGB color system. + * +hsv+: Interpolate in the HSV color system. + * +hsl+: Interpolate in the HSL color system. + * +none+: Don't show a gradient. + +Default: +pass:[rgb]+ + +[[colors.tabs.odd.bg]] +=== colors.tabs.odd.bg +Background color of unselected odd tabs. + +Type: <> + +Default: +pass:[grey]+ + +[[colors.tabs.odd.fg]] +=== colors.tabs.odd.fg +Foreground color of unselected odd tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.selected.even.bg]] +=== colors.tabs.selected.even.bg +Background color of selected even tabs. + +Type: <> + +Default: +pass:[black]+ + +[[colors.tabs.selected.even.fg]] +=== colors.tabs.selected.even.fg +Foreground color of selected even tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.selected.odd.bg]] +=== colors.tabs.selected.odd.bg +Background color of selected odd tabs. + +Type: <> + +Default: +pass:[black]+ + +[[colors.tabs.selected.odd.fg]] +=== colors.tabs.selected.odd.fg +Foreground color of selected odd tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.webpage.bg]] +=== colors.webpage.bg +Background color for webpages if unset (or empty to use the theme's color) + +Type: <> + +Default: +pass:[white]+ + +[[completion.cmd_history_max_items]] +=== completion.cmd_history_max_items +How many commands to save in the command history. +0: no history / -1: unlimited + +Type: <> + +Default: +pass:[100]+ + +[[completion.height]] +=== completion.height +The height of the completion, in px or as percentage of the window. + +Type: <> + +Default: +pass:[50%]+ + +[[completion.quick]] +=== completion.quick +Move on to the next part when there's only one possible completion left. + +Type: <> Valid values: @@ -430,429 +1278,28 @@ Valid values: Default: +pass:[true]+ -[[general-xss-auditing]] -=== xss-auditing -Whether load requests should be monitored for cross-site scripting attempts. +[[completion.scrollbar.padding]] +=== completion.scrollbar.padding +Padding of scrollbar handle in the completion window (in px). -Suspicious scripts will be blocked and reported in the inspector's JavaScript console. Enabling this feature might have an impact on performance. +Type: <> -Valid values: +Default: +pass:[2]+ - * +true+ - * +false+ +[[completion.scrollbar.width]] +=== completion.scrollbar.width +Width of the scrollbar in the completion window (in px). -Default: +pass:[false]+ +Type: <> -[[general-default-encoding]] -=== default-encoding -Default encoding to use for websites. +Default: +pass:[12]+ -The encoding must be a string describing an encoding such as _utf-8_, _iso-8859-1_, etc. - -Default: +pass:[iso-8859-1]+ - -[[general-new-instance-open-target]] -=== new-instance-open-target -How to open links in an existing instance if a new one is launched. - -Valid values: - - * +tab+: Open a new tab in the existing window and activate the window. - * +tab-bg+: Open a new background tab in the existing window and activate the window. - * +tab-silent+: Open a new tab in the existing window without activating the window. - * +tab-bg-silent+: Open a new background tab in the existing window without activating the window. - * +window+: Open in a new window. - -Default: +pass:[tab]+ - -[[general-new-instance-open-target.window]] -=== new-instance-open-target.window -Which window to choose when opening links as new tabs. - -Valid values: - - * +first-opened+: Open new tabs in the first (oldest) opened window. - * +last-opened+: Open new tabs in the last (newest) opened window. - * +last-focused+: Open new tabs in the most recently focused window. - * +last-visible+: Open new tabs in the most recently visible window. - -Default: +pass:[last-focused]+ - -[[general-log-javascript-console]] -=== log-javascript-console -How to log javascript console messages. - -Valid values: - - * +none+: Don't log messages. - * +debug+: Log messages with debug level. - * +info+: Log messages with info level. - -Default: +pass:[debug]+ - -[[general-save-session]] -=== save-session -Whether to always save the open pages. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[general-session-default-name]] -=== session-default-name -The name of the session to save by default, or empty for the last loaded session. - -Default: empty - -[[general-url-incdec-segments]] -=== url-incdec-segments -The URL segments where `:navigate increment/decrement` will search for a number. - -Valid values: - - * +host+ - * +path+ - * +query+ - * +anchor+ - -Default: +pass:[path,query]+ - -== ui -General options related to the user interface. - -[[ui-history-session-interval]] -=== history-session-interval -The maximum time in minutes between two history items for them to be considered being from the same session. Use -1 to disable separation. - -Default: +pass:[30]+ - -[[ui-zoom-levels]] -=== zoom-levels -The available zoom levels, separated by commas. - -Default: +pass:[25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500%]+ - -[[ui-default-zoom]] -=== default-zoom -The default zoom level. - -Default: +pass:[100%]+ - -[[ui-downloads-position]] -=== downloads-position -Where to show the downloaded files. - -Valid values: - - * +top+ - * +bottom+ - -Default: +pass:[top]+ - -[[ui-status-position]] -=== status-position -The position of the status bar. - -Valid values: - - * +top+ - * +bottom+ - -Default: +pass:[bottom]+ - -[[ui-message-timeout]] -=== message-timeout -Time (in ms) to show messages in the statusbar for. -Set to 0 to never clear messages. - -Default: +pass:[2000]+ - -[[ui-message-unfocused]] -=== message-unfocused -Whether to show messages in unfocused windows. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[ui-confirm-quit]] -=== confirm-quit -Whether to confirm quitting the application. - -Valid values: - - * +always+: Always show a confirmation. - * +multiple-tabs+: Show a confirmation if multiple tabs are opened. - * +downloads+: Show a confirmation if downloads are running - * +never+: Never show a confirmation. - -Default: +pass:[never]+ - -[[ui-zoom-text-only]] -=== zoom-text-only -Whether the zoom factor on a frame applies only to the text or to all content. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -This setting is only available with the QtWebKit backend. - -[[ui-frame-flattening]] -=== frame-flattening -Whether to expand each subframe to its contents. - -This will flatten all the frames to become one scrollable page. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -This setting is only available with the QtWebKit backend. - -[[ui-user-stylesheet]] -=== user-stylesheet -User stylesheet to use (absolute filename or filename relative to the config directory). Will expand environment variables. - -Default: empty - -[[ui-hide-scrollbar]] -=== hide-scrollbar -Hide the main scrollbar. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[ui-smooth-scrolling]] -=== smooth-scrolling -Whether to enable smooth scrolling for web pages. Note smooth scrolling does not work with the :scroll-px command. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[ui-remove-finished-downloads]] -=== remove-finished-downloads -Number of milliseconds to wait before removing finished downloads. Will not be removed if value is -1. - -Default: +pass:[-1]+ - -[[ui-hide-statusbar]] -=== hide-statusbar -Whether to hide the statusbar unless a message is shown. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[ui-statusbar-padding]] -=== statusbar-padding -Padding for statusbar (top, bottom, left, right). - -Default: +pass:[1,1,0,0]+ - -[[ui-window-title-format]] -=== window-title-format -The format to use for the window title. The following placeholders are defined: - -* `{perc}`: The percentage as a string like `[10%]`. -* `{perc_raw}`: The raw percentage, e.g. `10` -* `{title}`: The title of the current web page -* `{title_sep}`: The string ` - ` if a title is set, empty otherwise. -* `{id}`: The internal window ID of this window. -* `{scroll_pos}`: The page scroll position. -* `{host}`: The host of the current web page. -* `{backend}`: Either 'webkit' or 'webengine' -* `{private}` : Indicates when private mode is enabled. - - -Default: +pass:[{perc}{title}{title_sep}qutebrowser]+ - -[[ui-modal-js-dialog]] -=== modal-js-dialog -Use standard JavaScript modal dialog for alert() and confirm() - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[ui-hide-wayland-decoration]] -=== hide-wayland-decoration -Hide the window decoration when using wayland (requires restart) - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[ui-keyhint-blacklist]] -=== keyhint-blacklist -Keychains that shouldn't be shown in the keyhint dialog - -Globs are supported, so ';*' will blacklist all keychainsstarting with ';'. Use '*' to disable keyhints - -Default: empty - -[[ui-keyhint-delay]] -=== keyhint-delay -Time from pressing a key to seeing the keyhint dialog (ms) - -Default: +pass:[500]+ - -[[ui-prompt-radius]] -=== prompt-radius -The rounding radius for the edges of prompts. - -Default: +pass:[8]+ - -[[ui-prompt-filebrowser]] -=== prompt-filebrowser -Show a filebrowser in upload/download prompts. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -== network -Settings related to the network. - -[[network-do-not-track]] -=== do-not-track -Value to send in the `DNT` header. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[network-accept-language]] -=== accept-language -Value to send in the `accept-language` header. - -Default: +pass:[en-US,en]+ - -[[network-referer-header]] -=== referer-header -Send the Referer header - -Valid values: - - * +always+: Always send. - * +never+: Never send; this is not recommended, as some sites may break. - * +same-domain+: Only send for the same domain. This will still protect your privacy, but shouldn't break any sites. - -Default: +pass:[same-domain]+ - -This setting is only available with the QtWebKit backend. - -[[network-user-agent]] -=== user-agent -User agent to send. Empty to send the default. - -Default: empty - -[[network-proxy]] -=== proxy -The proxy to use. - -In addition to the listed values, you can use a `socks://...` or `http://...` URL. - -Valid values: - - * +system+: Use the system wide proxy. - * +none+: Don't use any proxy - -Default: +pass:[system]+ - -[[network-proxy-dns-requests]] -=== proxy-dns-requests -Whether to send DNS requests over the configured proxy. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -This setting is only available with the QtWebKit backend. - -[[network-ssl-strict]] -=== ssl-strict -Whether to validate SSL handshakes. - -Valid values: - - * +true+ - * +false+ - * +ask+ - -Default: +pass:[ask]+ - -[[network-dns-prefetch]] -=== dns-prefetch -Whether to try to pre-fetch DNS entries to speed up browsing. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -This setting is only available with the QtWebKit backend. - -[[network-custom-headers]] -=== custom-headers -Set custom headers for qutebrowser HTTP requests. - -Default: empty - -[[network-netrc-file]] -=== netrc-file -Set location of a netrc-file for HTTP authentication. If empty, ~/.netrc is used. - -Default: empty - -== completion -Options related to completion and command history. - -[[completion-show]] -=== show +[[completion.show]] +=== completion.show When to show the autocompletion window. +Type: <> + Valid values: * +always+: Whenever a completion is available. @@ -861,473 +1308,59 @@ Valid values: Default: +pass:[always]+ -[[completion-download-path-suggestion]] -=== download-path-suggestion -What to display in the download filename input. +[[completion.shrink]] +=== completion.shrink +Shrink the completion to be smaller than the configured size if there are no scrollbars. + +Type: <> Valid values: - * +path+: Show only the download path. - * +filename+: Show only download filename. - * +both+: Show download path and filename. + * +true+ + * +false+ -Default: +pass:[path]+ +Default: empty -[[completion-timestamp-format]] -=== timestamp-format -How to format timestamps (e.g. for history) +[[completion.timestamp_format]] +=== completion.timestamp_format +How to format timestamps (e.g. for the history completion). + +Type: <> Default: +pass:[%Y-%m-%d]+ -[[completion-height]] -=== height -The height of the completion, in px or as percentage of the window. - -Default: +pass:[50%]+ - -[[completion-cmd-history-max-items]] -=== cmd-history-max-items -How many commands to save in the command history. - -0: no history / -1: unlimited - -Default: +pass:[100]+ - -[[completion-web-history-max-items]] -=== web-history-max-items +[[completion.web_history_max_items]] +=== completion.web_history_max_items How many URLs to show in the web history. - 0: no history / -1: unlimited +Type: <> + Default: +pass:[-1]+ -[[completion-quick-complete]] -=== quick-complete -Whether to move on to the next part when there's only one possible completion left. +[[confirm_quit]] +=== confirm_quit +Whether quitting the application requires a confirmation. + +Type: <> Valid values: - * +true+ - * +false+ + * +always+: Always show a confirmation. + * +multiple-tabs+: Show a confirmation if multiple tabs are opened. + * +downloads+: Show a confirmation if downloads are running + * +never+: Never show a confirmation. -Default: +pass:[true]+ +Default: -[[completion-shrink]] -=== shrink -Whether to shrink the completion to be smaller than the configured size if there are no scrollbars. +- +pass:[never]+ -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[completion-scrollbar-width]] -=== scrollbar-width -Width of the scrollbar in the completion window (in px). - -Default: +pass:[12]+ - -[[completion-scrollbar-padding]] -=== scrollbar-padding -Padding of scrollbar handle in completion window (in px). - -Default: +pass:[2]+ - -== input -Options related to input modes. - -[[input-timeout]] -=== timeout -Timeout (in milliseconds) for ambiguous key bindings. - -If the current input forms both a complete match and a partial match, the complete match will be executed after this time. - -Default: +pass:[500]+ - -[[input-partial-timeout]] -=== partial-timeout -Timeout (in milliseconds) for partially typed key bindings. - -If the current input forms only partial matches, the keystring will be cleared after this time. - -Default: +pass:[5000]+ - -[[input-insert-mode-on-plugins]] -=== insert-mode-on-plugins -Whether to switch to insert mode when clicking flash and other plugins. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[input-auto-leave-insert-mode]] -=== auto-leave-insert-mode -Whether to leave insert mode if a non-editable element is clicked. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[input-auto-insert-mode]] -=== auto-insert-mode -Whether to automatically enter insert mode if an editable element is focused after page load. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[input-forward-unbound-keys]] -=== forward-unbound-keys -Whether to forward unbound keys to the webview in normal mode. - -Valid values: - - * +all+: Forward all unbound keys. - * +auto+: Forward unbound non-alphanumeric keys. - * +none+: Don't forward any keys. - -Default: +pass:[auto]+ - -[[input-spatial-navigation]] -=== spatial-navigation -Enables or disables the Spatial Navigation feature. - -Spatial navigation consists in the ability to navigate between focusable elements in a Web page, such as hyperlinks and form controls, by using Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element he might be trying to reach towards the right and which element he probably wants. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[input-links-included-in-focus-chain]] -=== links-included-in-focus-chain -Whether hyperlinks should be included in the keyboard focus chain. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[input-rocker-gestures]] -=== rocker-gestures -Whether to enable Opera-like mouse rocker gestures. This disables the context menu. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[input-mouse-zoom-divider]] -=== mouse-zoom-divider -How much to divide the mouse wheel movements to translate them into zoom increments. - -Default: +pass:[512]+ - -== tabs -Configuration of the tab bar. - -[[tabs-background-tabs]] -=== background-tabs -Whether to open new tabs (middleclick/ctrl+click) in background. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[tabs-select-on-remove]] -=== select-on-remove -Which tab to select when the focused tab is removed. - -Valid values: - - * +prev+: Select the tab which came before the closed one (left in horizontal, above in vertical). - * +next+: Select the tab which came after the closed one (right in horizontal, below in vertical). - * +last-used+: Select the previously selected tab. - -Default: +pass:[next]+ - -[[tabs-new-tab-position]] -=== new-tab-position -How new tabs are positioned. - -Valid values: - - * +prev+: Before the current tab. - * +next+: After the current tab. - * +first+: At the beginning. - * +last+: At the end. - -Default: +pass:[next]+ - -[[tabs-new-tab-position-explicit]] -=== new-tab-position-explicit -How new tabs opened explicitly are positioned. - -Valid values: - - * +prev+: Before the current tab. - * +next+: After the current tab. - * +first+: At the beginning. - * +last+: At the end. - -Default: +pass:[last]+ - -[[tabs-last-close]] -=== last-close -Behavior when the last tab is closed. - -Valid values: - - * +ignore+: Don't do anything. - * +blank+: Load a blank page. - * +startpage+: Load the start page. - * +default-page+: Load the default page. - * +close+: Close the window. - -Default: +pass:[ignore]+ - -[[tabs-show]] -=== show -When to show the tab bar - -Valid values: - - * +always+: Always show the tab bar. - * +never+: Always hide the tab bar. - * +multiple+: Hide the tab bar if only one tab is open. - * +switching+: Show the tab bar when switching tabs. - -Default: +pass:[always]+ - -[[tabs-show-switching-delay]] -=== show-switching-delay -Time to show the tab bar before hiding it when tabs->show is set to 'switching'. - -Default: +pass:[800]+ - -[[tabs-wrap]] -=== wrap -Whether to wrap when changing tabs. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[tabs-movable]] -=== movable -Whether tabs should be movable. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[tabs-close-mouse-button]] -=== close-mouse-button -On which mouse button to close tabs. - -Valid values: - - * +right+: Close tabs on right-click. - * +middle+: Close tabs on middle-click. - * +none+: Don't close tabs using the mouse. - -Default: +pass:[middle]+ - -[[tabs-position]] -=== position -The position of the tab bar. - -Valid values: - - * +top+ - * +bottom+ - * +left+ - * +right+ - -Default: +pass:[top]+ - -[[tabs-show-favicons]] -=== show-favicons -Whether to show favicons in the tab bar. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[tabs-favicon-scale]] -=== favicon-scale -Scale for favicons in the tab bar. The tab size is unchanged, so big favicons also require extra `tabs->padding`. - -Default: +pass:[1.0]+ - -[[tabs-width]] -=== width -The width of the tab bar if it's vertical, in px or as percentage of the window. - -Default: +pass:[20%]+ - -[[tabs-pinned-width]] -=== pinned-width -The width for pinned tabs with a horizontal tabbar, in px. - -Default: +pass:[43]+ - -[[tabs-indicator-width]] -=== indicator-width -Width of the progress indicator (0 to disable). - -Default: +pass:[3]+ - -[[tabs-tabs-are-windows]] -=== tabs-are-windows -Whether to open windows instead of tabs. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[tabs-title-format]] -=== title-format -The format to use for the tab title. The following placeholders are defined: - -* `{perc}`: The percentage as a string like `[10%]`. -* `{perc_raw}`: The raw percentage, e.g. `10` -* `{title}`: The title of the current web page -* `{title_sep}`: The string ` - ` if a title is set, empty otherwise. -* `{index}`: The index of this tab. -* `{id}`: The internal tab ID of this tab. -* `{scroll_pos}`: The page scroll position. -* `{host}`: The host of the current web page. -* `{backend}`: Either 'webkit' or 'webengine' -* `{private}` : Indicates when private mode is enabled. - - -Default: +pass:[{index}: {title}]+ - -[[tabs-title-format-pinned]] -=== title-format-pinned -The format to use for the tab title for pinned tabs. The same placeholders like for title-format are defined. - -Default: +pass:[{index}]+ - -[[tabs-title-alignment]] -=== title-alignment -Alignment of the text inside of tabs - -Valid values: - - * +left+ - * +right+ - * +center+ - -Default: +pass:[left]+ - -[[tabs-mousewheel-tab-switching]] -=== mousewheel-tab-switching -Switch between tabs using the mouse wheel. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[tabs-padding]] -=== padding -Padding for tabs (top, bottom, left, right). - -Default: +pass:[0,0,5,5]+ - -[[tabs-indicator-padding]] -=== indicator-padding -Padding for indicators (top, bottom, left, right). - -Default: +pass:[2,2,0,4]+ - -== storage -Settings related to cache and storage. - -[[storage-download-directory]] -=== download-directory -The directory to save downloads to. An empty value selects a sensible os-specific default. Will expand environment variables. - -Default: empty - -[[storage-prompt-download-directory]] -=== prompt-download-directory -Whether to prompt the user for the download location. -If set to false, 'download-directory' will be used. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[storage-remember-download-directory]] -=== remember-download-directory -Whether to remember the last used download directory. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[storage-maximum-pages-in-cache]] -=== maximum-pages-in-cache -The maximum number of pages to hold in the global memory page cache. - -The Page Cache allows for a nicer user experience when navigating forth or back to pages in the forward/back history, by pausing and resuming up to _n_ pages. - -For more information about the feature, please refer to: http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ - -Default: +pass:[0]+ - -This setting is only available with the QtWebKit backend. - -[[storage-offline-web-application-cache]] -=== offline-web-application-cache +[[content.cache.appcache]] +=== content.cache.appcache Whether support for the HTML 5 web application cache feature is enabled. - An application cache acts like an HTTP cache in some sense. For documents that use the application cache via JavaScript, the loader engine will first ask the application cache for the contents, before hitting the network. -The feature is described in details at: http://dev.w3.org/html5/spec/Overview.html#appcache +Type: <> Valid values: @@ -1338,205 +1371,32 @@ Default: +pass:[true]+ This setting is only available with the QtWebKit backend. -[[storage-local-storage]] -=== local-storage -Whether support for HTML 5 local storage and Web SQL is enabled. +[[content.cache.maximum_pages]] +=== content.cache.maximum_pages +The maximum number of pages to hold in the global memory page cache. +The Page Cache allows for a nicer user experience when navigating forth or back to pages in the forward/back history, by pausing and resuming up to _n_ pages. +For more information about the feature, please refer to: http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[storage-cache-size]] -=== cache-size -Size of the HTTP network cache. Empty to use the default value. +Type: <> Default: empty -== content -Loaded plugins/scripts and allowed actions. - -[[content-allow-images]] -=== allow-images -Whether images are automatically loaded in web pages. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[content-allow-javascript]] -=== allow-javascript -Enables or disables the running of JavaScript programs. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[content-allow-plugins]] -=== allow-plugins -Enables or disables plugins in Web pages. - -Qt plugins with a mimetype such as "application/x-qt-plugin" are not affected by this setting. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-webgl]] -=== webgl -Enables or disables WebGL. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[content-hyperlink-auditing]] -=== hyperlink-auditing -Enable or disable hyperlink auditing (). - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-geolocation]] -=== geolocation -Allow websites to request geolocations. - -Valid values: - - * +true+ - * +false+ - * +ask+ - -Default: +pass:[ask]+ - -[[content-notifications]] -=== notifications -Allow websites to show notifications. - -Valid values: - - * +true+ - * +false+ - * +ask+ - -Default: +pass:[ask]+ - -[[content-media-capture]] -=== media-capture -Allow websites to record audio/video. - -Valid values: - - * +true+ - * +false+ - * +ask+ - -Default: +pass:[ask]+ - -This setting is only available with the QtWebEngine backend. - -[[content-javascript-can-open-windows-automatically]] -=== javascript-can-open-windows-automatically -Whether JavaScript programs can open new windows without user interaction. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-javascript-can-close-windows]] -=== javascript-can-close-windows -Whether JavaScript programs can close windows. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - This setting is only available with the QtWebKit backend. -[[content-javascript-can-access-clipboard]] -=== javascript-can-access-clipboard -Whether JavaScript programs can read or write to the clipboard. -With QtWebEngine, writing the clipboard as response to a user interaction is always allowed. +[[content.cache.size]] +=== content.cache.size +Size of the HTTP network cache. Null to use the default value. -Valid values: +Type: <> - * +true+ - * +false+ +Default: empty -Default: +pass:[false]+ - -[[content-ignore-javascript-prompt]] -=== ignore-javascript-prompt -Whether all javascript prompts should be ignored. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-ignore-javascript-alert]] -=== ignore-javascript-alert -Whether all javascript alerts should be ignored. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-local-content-can-access-remote-urls]] -=== local-content-can-access-remote-urls -Whether locally loaded documents are allowed to access remote urls. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[false]+ - -[[content-local-content-can-access-file-urls]] -=== local-content-can-access-file-urls -Whether locally loaded documents are allowed to access other local urls. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -[[content-cookies-accept]] -=== cookies-accept +[[content.cookies.accept]] +=== content.cookies.accept Control which cookies to accept. +Type: <> + Valid values: * +all+: Accept all cookies. @@ -1548,9 +1408,12 @@ Default: +pass:[no-3rdparty]+ This setting is only available with the QtWebKit backend. -[[content-cookies-store]] -=== cookies-store -Whether to store cookies. Note this option needs a restart with QtWebEngine on Qt < 5.9. +[[content.cookies.store]] +=== content.cookies.store +Store cookies. +Note this option needs a restart with QtWebEngine on Qt < 5.9. + +Type: <> Valid values: @@ -1559,88 +1422,196 @@ Valid values: Default: +pass:[true]+ -[[content-host-block-lists]] -=== host-block-lists +[[content.default_encoding]] +=== content.default_encoding +Default encoding to use for websites. +The encoding must be a string describing an encoding such as _utf-8_, _iso-8859-1_, etc. + +Type: <> + +Default: +pass:[iso-8859-1]+ + +[[content.developer_extras]] +=== content.developer_extras +Enable extra tools for Web developers. +This needs to be enabled for `:inspector` to work and also adds an _Inspect_ entry to the context menu. For QtWebEngine, see `--enable-webengine-inspector` in `qutebrowser --help` instead. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +This setting is only available with the QtWebKit backend. + +[[content.dns_prefetch]] +=== content.dns_prefetch +Try to pre-fetch DNS entries to speed up browsing. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +This setting is only available with the QtWebKit backend. + +[[content.frame_flattening]] +=== content.frame_flattening +Expand each subframe to its contents. +This will flatten all the frames to become one scrollable page. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +This setting is only available with the QtWebKit backend. + +[[content.geolocation]] +=== content.geolocation +Allow websites to request geolocations. + +Type: <> + +Valid values: + + * +true+ + * +false+ + * +ask+ + +Default: +pass:[ask]+ + +[[content.headers.accept_language]] +=== content.headers.accept_language +Value to send in the `Accept-Language` header. + +Type: <> + +Default: +pass:[en-US,en]+ + +[[content.headers.custom]] +=== content.headers.custom +Set custom headers for qutebrowser HTTP requests. + +Type: <> + +Default: empty + +[[content.headers.do_not_track]] +=== content.headers.do_not_track +Value to send in the `DNT` header. +When this is set to true, qutebrowser asks websites to not track your identity. If set to null, the DNT header is not sent at all. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.headers.referer]] +=== content.headers.referer +Send the Referer header. +The Referer header tells websites from which website you were coming from when visting them. + +Type: <> + +Valid values: + + * +always+: Always send the Referer. + * +never+: Never send the Referer. This is not recommended, as some sites may break. + * +same-domain+: Only send the Referer for the same domain. This will still protect your privacy, but shouldn't break any sites. + +Default: +pass:[same-domain]+ + +This setting is only available with the QtWebKit backend. + +[[content.headers.user_agent]] +=== content.headers.user_agent +User agent to send. Unset to send the default. + +Type: <> + +Default: empty + +[[content.host_blocking.enabled]] +=== content.host_blocking.enabled +Whether host blocking is enabled. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.host_blocking.lists]] +=== content.host_blocking.lists List of URLs of lists which contain hosts to block. The file can be in one of the following formats: -- An '/etc/hosts'-like file +- An `/etc/hosts`-like file - One host per line -- A zip-file of any of the above, with either only one file, or a file named 'hosts' (with any extension). +- A zip-file of any of the above, with either only one file, or a file named + `hosts` (with any extension). -Default: +pass:[https://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext]+ -[[content-host-blocking-enabled]] -=== host-blocking-enabled -Whether host blocking is enabled. +Type: <> -Valid values: +Default: - * +true+ - * +false+ +- +pass:[https://www.malwaredomainlist.com/hostslist/hosts.txt]+ +- +pass:[http://someonewhocares.org/hosts/hosts]+ +- +pass:[http://winhelp2002.mvps.org/hosts.zip]+ +- +pass:[http://malwaredomains.lehigh.edu/files/justdomains.zip]+ +- +pass:[https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext]+ -Default: +pass:[true]+ - -[[content-host-blocking-whitelist]] -=== host-blocking-whitelist +[[content.host_blocking.whitelist]] +=== content.host_blocking.whitelist List of domains that should always be loaded, despite being ad-blocked. - Domains may contain * and ? wildcards and are otherwise required to exactly match the requested domain. - Local domains are always exempt from hostblocking. -Default: +pass:[piwik.org]+ +Type: <> -[[content-enable-pdfjs]] -=== enable-pdfjs -Enable pdf.js to view PDF files in the browser. +Default: -Note that the files can still be downloaded by clicking the download button in the pdf.js viewer. +- +pass:[piwik.org]+ + +[[content.hyperlink_auditing]] +=== content.hyperlink_auditing +Enable or disable hyperlink auditing (``). + +Type: <> Valid values: * +true+ * +false+ -Default: +pass:[false]+ +Default: empty -== hints -Hinting settings. +[[content.images]] +=== content.images +Whether images are automatically loaded in web pages. -[[hints-border]] -=== border -CSS border value for hints. - -Default: +pass:[1px solid #E3BE23]+ - -[[hints-mode]] -=== mode -Mode to use for hints. - -Valid values: - - * +number+: Use numeric hints. (In this mode you can also type letters form the hinted element to filter and reduce the number of elements that are hinted.) - * +letter+: Use the chars in the hints -> chars setting. - * +word+: Use hints words based on the html elements and the extra words. - -Default: +pass:[letter]+ - -[[hints-chars]] -=== chars -Chars used for hint strings. - -Default: +pass:[asdfghjkl]+ - -[[hints-min-chars]] -=== min-chars -Minimum number of chars used for hint strings. - -Default: +pass:[1]+ - -[[hints-scatter]] -=== scatter -Whether to scatter hint key chains (like Vimium) or not (like dwb). Ignored for number hints. +Type: <> Valid values: @@ -1649,26 +1620,620 @@ Valid values: Default: +pass:[true]+ -[[hints-uppercase]] -=== uppercase -Make chars in hint strings uppercase. +[[content.javascript.alert]] +=== content.javascript.alert +Show javascript alerts. + +Type: <> Valid values: * +true+ * +false+ -Default: +pass:[false]+ +Default: +pass:[true]+ -[[hints-dictionary]] -=== dictionary -The dictionary file to be used by the word hints. +[[content.javascript.can_access_clipboard]] +=== content.javascript.can_access_clipboard +Whether JavaScript can read from or write to the clipboard. +With QtWebEngine, writing the clipboard as response to a user interaction is always allowed. -Default: +pass:[/usr/share/dict/words]+ +Type: <> -[[hints-auto-follow]] -=== auto-follow -Controls when a hint can be automatically followed without the user pressing Enter. +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.javascript.can_close_tabs]] +=== content.javascript.can_close_tabs +Whether JavaScript can close tabs. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +This setting is only available with the QtWebKit backend. + +[[content.javascript.can_open_tabs_automatically]] +=== content.javascript.can_open_tabs_automatically +Whether JavaScript can open new tabs without user interaction. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.javascript.enabled]] +=== content.javascript.enabled +Enables or disables JavaScript. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.javascript.log]] +=== content.javascript.log +Log levels to use for JavaScript console logging messages. +On QtWebKit, the "unknown" setting is always used. + +Type: <> + +Default: + +- +pass:[error]+: +pass:[debug]+ +- +pass:[info]+: +pass:[debug]+ +- +pass:[unknown]+: +pass:[debug]+ +- +pass:[warning]+: +pass:[debug]+ + +[[content.javascript.modal_dialog]] +=== content.javascript.modal_dialog +Use the standard JavaScript modal dialog for `alert()` and `confirm()` + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.javascript.prompt]] +=== content.javascript.prompt +Show javascript prompts. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.local_content_can_access_file_urls]] +=== content.local_content_can_access_file_urls +Whether locally loaded documents are allowed to access other local urls. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.local_content_can_access_remote_urls]] +=== content.local_content_can_access_remote_urls +Whether locally loaded documents are allowed to access remote urls. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.local_storage]] +=== content.local_storage +Whether support for HTML 5 local storage and Web SQL is enabled. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.media_capture]] +=== content.media_capture +Allow websites to record audio/video. + +Type: <> + +Valid values: + + * +true+ + * +false+ + * +ask+ + +Default: +pass:[ask]+ + +This setting is only available with the QtWebEngine backend. + +[[content.netrc_file]] +=== content.netrc_file +Location of a netrc-file for HTTP authentication. +If unset, `~/.netrc` is used. + +Type: <> + +Default: empty + +[[content.notifications]] +=== content.notifications +Allow websites to show notifications. + +Type: <> + +Valid values: + + * +true+ + * +false+ + * +ask+ + +Default: +pass:[ask]+ + +[[content.pdfjs]] +=== content.pdfjs +Enable pdf.js to view PDF files in the browser. +Note that the files can still be downloaded by clicking the download button in the pdf.js viewer. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +This setting is only available with the QtWebKit backend. + +[[content.plugins]] +=== content.plugins +Enables or disables plugins in Web pages. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.print_element_backgrounds]] +=== content.print_element_backgrounds +Whether the background color and images are also drawn when the page is printed. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +On QtWebEngine, this setting requires Qt 5.8 or newer. + +[[content.private_browsing]] +=== content.private_browsing +Open new windows in private browsing mode which does not record visited pages. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[content.proxy]] +=== content.proxy +The proxy to use. +In addition to the listed values, you can use a `socks://...` or `http://...` URL. + +Type: <> + +Valid values: + + * +system+: Use the system wide proxy. + * +none+: Don't use any proxy + +Default: +pass:[system]+ + +[[content.proxy_dns_requests]] +=== content.proxy_dns_requests +Send DNS requests over the configured proxy. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +This setting is only available with the QtWebKit backend. + +[[content.ssl_strict]] +=== content.ssl_strict +Validate SSL handshakes. + +Type: <> + +Valid values: + + * +true+ + * +false+ + * +ask+ + +Default: +pass:[ask]+ + +[[content.user_stylesheets]] +=== content.user_stylesheets +A list of user stylesheet filenames to use. + +Type: <> + +Default: empty + +[[content.webgl]] +=== content.webgl +Enables or disables WebGL. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[content.xss_auditing]] +=== content.xss_auditing +Whether load requests should be monitored for cross-site scripting attempts. +Suspicious scripts will be blocked and reported in the inspector\'s JavaScript console. Enabling this feature might have an impact on performance. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[downloads.location.directory]] +=== downloads.location.directory +The directory to save downloads to. +If unset, a sensible os-specific default is used. + +Type: <> + +Default: empty + +[[downloads.location.prompt]] +=== downloads.location.prompt +Prompt the user for the download location. +If set to false, `downloads.location.directory` will be used. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[downloads.location.remember]] +=== downloads.location.remember +Remember the last used download directory. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[downloads.location.suggestion]] +=== downloads.location.suggestion +What to display in the download filename input. + +Type: <> + +Valid values: + + * +path+: Show only the download path. + * +filename+: Show only download filename. + * +both+: Show download path and filename. + +Default: +pass:[path]+ + +[[downloads.open_dispatcher]] +=== downloads.open_dispatcher +The default program used to open downloads. +If null, the default internal handler is used. +Any `{}` in the string will be expanded to the filename, else the filename will be appended. + +Type: <> + +Default: empty + +[[downloads.position]] +=== downloads.position +Where to show the downloaded files. + +Type: <> + +Valid values: + + * +top+ + * +bottom+ + +Default: +pass:[top]+ + +[[downloads.remove_finished]] +=== downloads.remove_finished +Number of milliseconds to wait before removing finished downloads. +If set to -1, downloads are never removed. + +Type: <> + +Default: +pass:[-1]+ + +[[editor.command]] +=== editor.command +The editor (and arguments) to use for the `open-editor` command. +`{}` gets replaced by the filename of the file to be edited. + +Type: <> + +Default: + +- +pass:[gvim]+ +- +pass:[-f]+ +- +pass:[{}]+ + +[[editor.encoding]] +=== editor.encoding +Encoding to use for the editor. + +Type: <> + +Default: +pass:[utf-8]+ + +[[fonts.completion.category]] +=== fonts.completion.category +Font used in the completion categories. + +Type: <> + +Default: +pass:[bold 8pt monospace]+ + +[[fonts.completion.entry]] +=== fonts.completion.entry +Font used in the completion widget. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.debug_console]] +=== fonts.debug_console +Font used for the debugging console. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.downloads]] +=== fonts.downloads +Font used for the downloadbar. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.hints]] +=== fonts.hints +Font used for the hints. + +Type: <> + +Default: +pass:[bold 13px monospace]+ + +[[fonts.keyhint]] +=== fonts.keyhint +Font used in the keyhint widget. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.messages.error]] +=== fonts.messages.error +Font used for error messages. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.messages.info]] +=== fonts.messages.info +Font used for info messages. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.messages.warning]] +=== fonts.messages.warning +Font used for warning messages. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.monospace]] +=== fonts.monospace +Default monospace fonts. +Whenever "monospace" is used in a font setting, it\'s replaced with the fonts listed here. + +Type: <> + +Default: +pass:["xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal]+ + +[[fonts.prompts]] +=== fonts.prompts +Font used for prompts. + +Type: <> + +Default: +pass:[8pt sans-serif]+ + +[[fonts.statusbar]] +=== fonts.statusbar +Font used in the statusbar. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.tabs]] +=== fonts.tabs +Font used in the tab bar. + +Type: <> + +Default: +pass:[8pt monospace]+ + +[[fonts.web.family.cursive]] +=== fonts.web.family.cursive +Font family for cursive fonts. + +Type: <> + +Default: empty + +[[fonts.web.family.fantasy]] +=== fonts.web.family.fantasy +Font family for fantasy fonts. + +Type: <> + +Default: empty + +[[fonts.web.family.fixed]] +=== fonts.web.family.fixed +Font family for fixed fonts. + +Type: <> + +Default: empty + +[[fonts.web.family.sans_serif]] +=== fonts.web.family.sans_serif +Font family for sans-serif fonts. + +Type: <> + +Default: empty + +[[fonts.web.family.serif]] +=== fonts.web.family.serif +Font family for serif fonts. + +Type: <> + +Default: empty + +[[fonts.web.family.standard]] +=== fonts.web.family.standard +Font family for standard fonts. + +Type: <> + +Default: empty + +[[fonts.web.size.default]] +=== fonts.web.size.default +The default font size for regular text. + +Type: <> + +Default: +pass:[16]+ + +[[fonts.web.size.default_fixed]] +=== fonts.web.size.default_fixed +The default font size for fixed-pitch text. + +Type: <> + +Default: +pass:[13]+ + +[[fonts.web.size.minimum]] +=== fonts.web.size.minimum +The hard minimum font size. + +Type: <> + +Default: empty + +[[fonts.web.size.minimum_logical]] +=== fonts.web.size.minimum_logical +The minimum logical font size that is applied when zooming out. + +Type: <> + +Default: +pass:[6]+ + +[[hints.auto_follow]] +=== hints.auto_follow +Controls when a hint can be automatically followed without pressing Enter. + +Type: <> Valid values: @@ -1679,28 +2244,44 @@ Valid values: Default: +pass:[unique-match]+ -[[hints-auto-follow-timeout]] -=== auto-follow-timeout -A timeout (in milliseconds) to inhibit normal-mode key bindings after a successful auto-follow. +[[hints.auto_follow_timeout]] +=== hints.auto_follow_timeout +A timeout (in milliseconds) to ignore normal-mode key bindings after a successful auto-follow. -Default: +pass:[0]+ +Type: <> -[[hints-next-regexes]] -=== next-regexes -A comma-separated list of regexes to use for 'next' links. +Default: empty -Default: +pass:[\bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b]+ +[[hints.border]] +=== hints.border +CSS border value for hints. -[[hints-prev-regexes]] -=== prev-regexes -A comma-separated list of regexes to use for 'prev' links. +Type: <> -Default: +pass:[\bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b]+ +Default: +pass:[1px solid #E3BE23]+ -[[hints-find-implementation]] -=== find-implementation +[[hints.chars]] +=== hints.chars +Chars used for hint strings. + +Type: <> + +Default: +pass:[asdfghjkl]+ + +[[hints.dictionary]] +=== hints.dictionary +The dictionary file to be used by the word hints. + +Type: <> + +Default: +pass:[/usr/share/dict/words]+ + +[[hints.find_implementation]] +=== hints.find_implementation Which implementation to use to find elements to hint. +Type: <> + Valid values: * +javascript+: Better but slower @@ -1708,9 +2289,13 @@ Valid values: Default: +pass:[python]+ -[[hints-hide-unmatched-rapid-hints]] -=== hide-unmatched-rapid-hints -Controls hiding unmatched hints in rapid mode. +This setting is only available with the QtWebKit backend. + +[[hints.hide_unmatched_rapid_hints]] +=== hints.hide_unmatched_rapid_hints +Hide unmatched hints in rapid mode. + +Type: <> Valid values: @@ -1719,649 +2304,889 @@ Valid values: Default: +pass:[true]+ -== searchengines +[[hints.min_chars]] +=== hints.min_chars +Minimum number of chars used for hint strings. + +Type: <> + +Default: +pass:[1]+ + +[[hints.mode]] +=== hints.mode +Mode to use for hints. + +Type: <> + +Valid values: + + * +number+: Use numeric hints. (In this mode you can also type letters from the hinted element to filter and reduce the number of elements that are hinted.) + * +letter+: Use the chars in the `hints.chars` setting. + * +word+: Use hints words based on the html elements and the extra words. + +Default: +pass:[letter]+ + +[[hints.next_regexes]] +=== hints.next_regexes +A comma-separated list of regexes to use for 'next' links. + +Type: <> + +Default: + +- +pass:[\bnext\b]+ +- +pass:[\bmore\b]+ +- +pass:[\bnewer\b]+ +- +pass:[\b[>→≫]\b]+ +- +pass:[\b(>>|»)\b]+ +- +pass:[\bcontinue\b]+ + +[[hints.prev_regexes]] +=== hints.prev_regexes +A comma-separated list of regexes to use for 'prev' links. + +Type: <> + +Default: + +- +pass:[\bprev(ious)?\b]+ +- +pass:[\bback\b]+ +- +pass:[\bolder\b]+ +- +pass:[\b[<←≪]\b]+ +- +pass:[\b(<<|«)\b]+ + +[[hints.scatter]] +=== hints.scatter +Scatter hint key chains (like Vimium) or not (like dwb). +Ignored for number hints. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[hints.uppercase]] +=== hints.uppercase +Make chars in hint strings uppercase. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[history_gap_interval]] +=== history_gap_interval +The maximum time in minutes between two history items for them to be considered being from the same browsing session. +Items with less time between them are grouped when being displayed in `:history`. Use -1 to disable separation. + +Type: <> + +Default: +pass:[30]+ + +[[ignore_case]] +=== ignore_case +Find text on a page case-insensitively. + +Type: <> + +Valid values: + + * +always+: Search case-insensitively + * +never+: Search case-sensitively + * +smart+: Search case-sensitively if there are capital chars + +Default: +pass:[smart]+ + +[[input.forward_unbound_keys]] +=== input.forward_unbound_keys +Forward unbound keys to the webview in normal mode. + +Type: <> + +Valid values: + + * +all+: Forward all unbound keys. + * +auto+: Forward unbound non-alphanumeric keys. + * +none+: Don't forward any keys. + +Default: +pass:[auto]+ + +[[input.insert_mode.auto_leave]] +=== input.insert_mode.auto_leave +Leave insert mode if a non-editable element is clicked. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[input.insert_mode.auto_load]] +=== input.insert_mode.auto_load +Automatically enter insert mode if an editable element is focused after loading the page. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[input.insert_mode.plugins]] +=== input.insert_mode.plugins +Switch to insert mode when clicking flash and other plugins. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[input.links_included_in_focus_chain]] +=== input.links_included_in_focus_chain +Include hyperlinks in the keyboard focus chain when tabbing. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[input.partial_timeout]] +=== input.partial_timeout +Timeout (in milliseconds) for partially typed key bindings. +If the current input forms only partial matches, the keystring will be cleared after this time. + +Type: <> + +Default: +pass:[5000]+ + +[[input.rocker_gestures]] +=== input.rocker_gestures +Enable Opera-like mouse rocker gestures. +This disables the context menu. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[input.spatial_navigation]] +=== input.spatial_navigation +Enable Spatial Navigation. +Spatial navigation consists in the ability to navigate between focusable elements in a Web page, such as hyperlinks and form controls, by using Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element he might be trying to reach towards the right and which element he probably wants. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[keyhint.blacklist]] +=== keyhint.blacklist +Keychains that shouldn\'t be shown in the keyhint dialog. +Globs are supported, so `;*` will blacklist all keychains starting with `;`. Use `*` to disable keyhints. + +Type: <> + +Default: empty + +[[keyhint.delay]] +=== keyhint.delay +Time from pressing a key to seeing the keyhint dialog (ms). + +Type: <> + +Default: +pass:[500]+ + +[[messages.timeout]] +=== messages.timeout +Time (in ms) to show messages in the statusbar for. +Set to 0 to never clear messages. + +Type: <> + +Default: +pass:[2000]+ + +[[messages.unfocused]] +=== messages.unfocused +Show messages in unfocused windows. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[new_instance_open_target]] +=== new_instance_open_target +How to open links in an existing instance if a new one is launched. +This happens when e.g. opening a link from a terminal. +See `new_instance_open_target_window` to customize in which window the link is opened in. + +Type: <> + +Valid values: + + * +tab+: Open a new tab in the existing window and activate the window. + * +tab-bg+: Open a new background tab in the existing window and activate the window. + * +tab-silent+: Open a new tab in the existing window without activating the window. + * +tab-bg-silent+: Open a new background tab in the existing window without activating the window. + * +window+: Open in a new window. + +Default: +pass:[tab]+ + +[[new_instance_open_target_window]] +=== new_instance_open_target_window +Which window to choose when opening links as new tabs. +When `new_instance_open_target` is not set to `window`, this is ignored. + +Type: <> + +Valid values: + + * +first-opened+: Open new tabs in the first (oldest) opened window. + * +last-opened+: Open new tabs in the last (newest) opened window. + * +last-focused+: Open new tabs in the most recently focused window. + * +last-visible+: Open new tabs in the most recently visible window. + +Default: +pass:[last-focused]+ + +[[prompt.filebrowser]] +=== prompt.filebrowser +Show a filebrowser in upload/download prompts. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[prompt.radius]] +=== prompt.radius +The rounding radius for the edges of prompts. + +Type: <> + +Default: +pass:[8]+ + +[[scrolling.bar]] +=== scrolling.bar +Show a scrollbar. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[scrolling.smooth]] +=== scrolling.smooth +Enable smooth scrolling for web pages. +Note smooth scrolling does not work with the `:scroll-px` command. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[session_default_name]] +=== session_default_name +The name of the session to save by default. +If this is set to null, the session which was last loaded is saved. + +Type: <> + +Default: empty + +[[statusbar.hide]] +=== statusbar.hide +Hide the statusbar unless a message is shown. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[statusbar.padding]] +=== statusbar.padding +Padding for the statusbar. + +Type: <> + +Default: + +- +pass:[bottom]+: +pass:[1]+ +- +pass:[left]+: empty +- +pass:[right]+: empty +- +pass:[top]+: +pass:[1]+ + +[[statusbar.position]] +=== statusbar.position +The position of the status bar. + +Type: <> + +Valid values: + + * +top+ + * +bottom+ + +Default: +pass:[bottom]+ + +[[tabs.background]] +=== tabs.background +Open new tabs (middleclick/ctrl+click) in the background. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[tabs.close_mouse_button]] +=== tabs.close_mouse_button +On which mouse button to close tabs. + +Type: <> + +Valid values: + + * +right+: Close tabs on right-click. + * +middle+: Close tabs on middle-click. + * +none+: Don't close tabs using the mouse. + +Default: +pass:[middle]+ + +[[tabs.favicons.scale]] +=== tabs.favicons.scale +Scaling for favicons in the tab bar. +The tab size is unchanged, so big favicons also require extra `tabs.padding`. + +Type: <> + +Default: +pass:[1.0]+ + +[[tabs.favicons.show]] +=== tabs.favicons.show +Show favicons in the tab bar. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[tabs.indicator_padding]] +=== tabs.indicator_padding +Padding for tab indicators + +Type: <> + +Default: + +- +pass:[bottom]+: +pass:[2]+ +- +pass:[left]+: empty +- +pass:[right]+: +pass:[4]+ +- +pass:[top]+: +pass:[2]+ + +[[tabs.last_close]] +=== tabs.last_close +Behavior when the last tab is closed. + +Type: <> + +Valid values: + + * +ignore+: Don't do anything. + * +blank+: Load a blank page. + * +startpage+: Load the start page. + * +default-page+: Load the default page. + * +close+: Close the window. + +Default: +pass:[ignore]+ + +[[tabs.mousewheel_switching]] +=== tabs.mousewheel_switching +Switch between tabs using the mouse wheel. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[tabs.new_position.related]] +=== tabs.new_position.related +How new tabs opened from another tab are positioned. + +Type: <> + +Valid values: + + * +prev+: Before the current tab. + * +next+: After the current tab. + * +first+: At the beginning. + * +last+: At the end. + +Default: +pass:[next]+ + +[[tabs.new_position.unrelated]] +=== tabs.new_position.unrelated +How new tabs which aren't opened from another tab are positioned. + +Type: <> + +Valid values: + + * +prev+: Before the current tab. + * +next+: After the current tab. + * +first+: At the beginning. + * +last+: At the end. + +Default: +pass:[last]+ + +[[tabs.padding]] +=== tabs.padding +Padding around text for tabs + +Type: <> + +Default: + +- +pass:[bottom]+: empty +- +pass:[left]+: +pass:[5]+ +- +pass:[right]+: +pass:[5]+ +- +pass:[top]+: empty + +[[tabs.position]] +=== tabs.position +The position of the tab bar. + +Type: <> + +Valid values: + + * +top+ + * +bottom+ + * +left+ + * +right+ + +Default: +pass:[top]+ + +[[tabs.select_on_remove]] +=== tabs.select_on_remove +Which tab to select when the focused tab is removed. + +Type: <> + +Valid values: + + * +prev+: Select the tab which came before the closed one (left in horizontal, above in vertical). + * +next+: Select the tab which came after the closed one (right in horizontal, below in vertical). + * +last-used+: Select the previously selected tab. + +Default: +pass:[next]+ + +[[tabs.show]] +=== tabs.show +When to show the tab bar. + +Type: <> + +Valid values: + + * +always+: Always show the tab bar. + * +never+: Always hide the tab bar. + * +multiple+: Hide the tab bar if only one tab is open. + * +switching+: Show the tab bar when switching tabs. + +Default: +pass:[always]+ + +[[tabs.show_switching_delay]] +=== tabs.show_switching_delay +Time to show the tab bar before hiding it when tabs.show is set to 'switching'. + +Type: <> + +Default: +pass:[800]+ + +[[tabs.tabs_are_windows]] +=== tabs.tabs_are_windows +Open a new window for every tab. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: empty + +[[tabs.title.alignment]] +=== tabs.title.alignment +Alignment of the text inside of tabs. + +Type: <> + +Valid values: + + * +left+ + * +right+ + * +center+ + +Default: +pass:[left]+ + +[[tabs.title.format]] +=== tabs.title.format +The format to use for the tab title. +The following placeholders are defined: + +* `{perc}`: The percentage as a string like `[10%]`. +* `{perc_raw}`: The raw percentage, e.g. `10` +* `{title}`: The title of the current web page +* `{title_sep}`: The string ` - ` if a title is set, empty otherwise. +* `{index}`: The index of this tab. +* `{id}`: The internal tab ID of this tab. +* `{scroll_pos}`: The page scroll position. +* `{host}`: The host of the current web page. +* `{backend}`: Either ''webkit'' or ''webengine'' +* `{private}` : Indicates when private mode is enabled. + + +Type: <> + +Default: +pass:[{index}: {title}]+ + +[[tabs.title.format_pinned]] +=== tabs.title.format_pinned +The format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined. + +Type: <> + +Default: +pass:[{index}]+ + +[[tabs.width.bar]] +=== tabs.width.bar +The width of the tab bar if it's vertical, in px or as percentage of the window. + +Type: <> + +Default: +pass:[20%]+ + +[[tabs.width.indicator]] +=== tabs.width.indicator +Width of the progress indicator (0 to disable). + +Type: <> + +Default: +pass:[3]+ + +[[tabs.width.pinned]] +=== tabs.width.pinned +The width for pinned tabs with a horizontal tabbar, in px. + +Type: <> + +Default: +pass:[43]+ + +[[tabs.wrap]] +=== tabs.wrap +Whether to wrap when changing tabs. + +Type: <> + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + +[[url.auto_search]] +=== url.auto_search +Whether to start a search when something else than a URL is entered. + +Type: <> + +Valid values: + + * +naive+: Use simple/naive check. + * +dns+: Use DNS requests (might be slow!). + * +never+: Never search automatically. + +Default: +pass:[naive]+ + +[[url.default_page]] +=== url.default_page +The page to open if :open -t/-b/-w is used without URL. +Use `about:blank` for a blank page. + +Type: <> + +Default: +pass:[https://start.duckduckgo.com/]+ + +[[url.incdec_segments]] +=== url.incdec_segments +The URL segments where `:navigate increment/decrement` will search for a number. + +Type: <> + +Valid values: + + * +host+ + * +path+ + * +query+ + * +anchor+ + +Default: + +- +pass:[path]+ +- +pass:[query]+ + +[[url.searchengines]] +=== url.searchengines Definitions of search engines which can be used via the address bar. -The searchengine named `DEFAULT` is used when `general -> auto-search` is true and something else than a URL was entered to be opened. Other search engines can be used by prepending the search engine name to the search term, e.g. `:open google qutebrowser`. The string `{}` will be replaced by the search term, use `{{` and `}}` for literal `{`/`}` signs. +The searchengine named `DEFAULT` is used when `url.auto_search` is turned on and something else than a URL was entered to be opened. Other search engines can be used by prepending the search engine name to the search term, e.g. `:open google qutebrowser`. The string `{}` will be replaced by the search term, use `{{` and `}}` for literal `{`/`}` signs. -== aliases -Aliases for commands. -By default, no aliases are defined. Example which adds a new command `:qtb` to open qutebrowsers website: +Type: <> -`qtb = open https://www.qutebrowser.org/` +Default: -== colors -Colors used in the UI. -A value can be in one of the following format: +- +pass:[DEFAULT]+: +pass:[https://duckduckgo.com/?q={}]+ - * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` - * An SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. - * transparent (no color) - * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) - * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) - * A gradient as explained in http://doc.qt.io/qt-5/stylesheet-reference.html#list-of-property-types[the Qt documentation] under ``Gradient''. +[[url.start_pages]] +=== url.start_pages +The page(s) to open at the start. -A *.system value determines the color system to use for color interpolation between similarly-named *.start and *.stop entries, regardless of how they are defined in the options. Valid values are 'rgb', 'hsv', and 'hsl'. +Type: <> -The `hints.*` values are a special case as they're real CSS colors, not Qt-CSS colors. There, for a gradient, you need to use `-webkit-gradient`, see https://www.webkit.org/blog/175/introducing-css-gradients/[the WebKit documentation]. +Default: -[[colors-completion.fg]] -=== completion.fg -Text color of the completion widget. +- +pass:[https://start.duckduckgo.com]+ -Default: +pass:[white]+ +[[url.yank_ignored_parameters]] +=== url.yank_ignored_parameters +The URL parameters to strip with `:yank url`. -[[colors-completion.bg]] -=== completion.bg -Background color of the completion widget. +Type: <> -Default: +pass:[#333333]+ +Default: -[[colors-completion.alternate-bg]] -=== completion.alternate-bg -Alternating background color of the completion widget. +- +pass:[ref]+ +- +pass:[utm_source]+ +- +pass:[utm_medium]+ +- +pass:[utm_campaign]+ +- +pass:[utm_term]+ +- +pass:[utm_content]+ -Default: +pass:[#444444]+ +[[window.hide_wayland_decoration]] +=== window.hide_wayland_decoration +Hide the window decoration when using wayland (requires restart) -[[colors-completion.category.fg]] -=== completion.category.fg -Foreground color of completion widget category headers. - -Default: +pass:[white]+ - -[[colors-completion.category.bg]] -=== completion.category.bg -Background color of the completion widget category headers. - -Default: +pass:[qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)]+ - -[[colors-completion.category.border.top]] -=== completion.category.border.top -Top border color of the completion widget category headers. - -Default: +pass:[black]+ - -[[colors-completion.category.border.bottom]] -=== completion.category.border.bottom -Bottom border color of the completion widget category headers. - -Default: +pass:[${completion.category.border.top}]+ - -[[colors-completion.item.selected.fg]] -=== completion.item.selected.fg -Foreground color of the selected completion item. - -Default: +pass:[black]+ - -[[colors-completion.item.selected.bg]] -=== completion.item.selected.bg -Background color of the selected completion item. - -Default: +pass:[#e8c000]+ - -[[colors-completion.item.selected.border.top]] -=== completion.item.selected.border.top -Top border color of the completion widget category headers. - -Default: +pass:[#bbbb00]+ - -[[colors-completion.item.selected.border.bottom]] -=== completion.item.selected.border.bottom -Bottom border color of the selected completion item. - -Default: +pass:[${completion.item.selected.border.top}]+ - -[[colors-completion.match.fg]] -=== completion.match.fg -Foreground color of the matched text in the completion. - -Default: +pass:[#ff4444]+ - -[[colors-completion.scrollbar.fg]] -=== completion.scrollbar.fg -Color of the scrollbar handle in completion view. - -Default: +pass:[${completion.fg}]+ - -[[colors-completion.scrollbar.bg]] -=== completion.scrollbar.bg -Color of the scrollbar in completion view - -Default: +pass:[${completion.bg}]+ - -[[colors-statusbar.fg]] -=== statusbar.fg -Foreground color of the statusbar. - -Default: +pass:[white]+ - -[[colors-statusbar.bg]] -=== statusbar.bg -Background color of the statusbar. - -Default: +pass:[black]+ - -[[colors-statusbar.fg.private]] -=== statusbar.fg.private -Foreground color of the statusbar in private browsing mode. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.private]] -=== statusbar.bg.private -Background color of the statusbar in private browsing mode. - -Default: +pass:[#666666]+ - -[[colors-statusbar.fg.insert]] -=== statusbar.fg.insert -Foreground color of the statusbar in insert mode. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.insert]] -=== statusbar.bg.insert -Background color of the statusbar in insert mode. - -Default: +pass:[darkgreen]+ - -[[colors-statusbar.fg.command]] -=== statusbar.fg.command -Foreground color of the statusbar in command mode. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.command]] -=== statusbar.bg.command -Background color of the statusbar in command mode. - -Default: +pass:[${statusbar.bg}]+ - -[[colors-statusbar.fg.command.private]] -=== statusbar.fg.command.private -Foreground color of the statusbar in private browsing + command mode. - -Default: +pass:[${statusbar.fg.private}]+ - -[[colors-statusbar.bg.command.private]] -=== statusbar.bg.command.private -Background color of the statusbar in private browsing + command mode. - -Default: +pass:[${statusbar.bg.private}]+ - -[[colors-statusbar.fg.caret]] -=== statusbar.fg.caret -Foreground color of the statusbar in caret mode. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.caret]] -=== statusbar.bg.caret -Background color of the statusbar in caret mode. - -Default: +pass:[purple]+ - -[[colors-statusbar.fg.caret-selection]] -=== statusbar.fg.caret-selection -Foreground color of the statusbar in caret mode with a selection - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.caret-selection]] -=== statusbar.bg.caret-selection -Background color of the statusbar in caret mode with a selection - -Default: +pass:[#a12dff]+ - -[[colors-statusbar.progress.bg]] -=== statusbar.progress.bg -Background color of the progress bar. - -Default: +pass:[white]+ - -[[colors-statusbar.url.fg]] -=== statusbar.url.fg -Default foreground color of the URL in the statusbar. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.url.fg.success]] -=== statusbar.url.fg.success -Foreground color of the URL in the statusbar on successful load (http). - -Default: +pass:[white]+ - -[[colors-statusbar.url.fg.success.https]] -=== statusbar.url.fg.success.https -Foreground color of the URL in the statusbar on successful load (https). - -Default: +pass:[lime]+ - -[[colors-statusbar.url.fg.error]] -=== statusbar.url.fg.error -Foreground color of the URL in the statusbar on error. - -Default: +pass:[orange]+ - -[[colors-statusbar.url.fg.warn]] -=== statusbar.url.fg.warn -Foreground color of the URL in the statusbar when there's a warning. - -Default: +pass:[yellow]+ - -[[colors-statusbar.url.fg.hover]] -=== statusbar.url.fg.hover -Foreground color of the URL in the statusbar for hovered links. - -Default: +pass:[aqua]+ - -[[colors-tabs.fg.odd]] -=== tabs.fg.odd -Foreground color of unselected odd tabs. - -Default: +pass:[white]+ - -[[colors-tabs.bg.odd]] -=== tabs.bg.odd -Background color of unselected odd tabs. - -Default: +pass:[grey]+ - -[[colors-tabs.fg.even]] -=== tabs.fg.even -Foreground color of unselected even tabs. - -Default: +pass:[white]+ - -[[colors-tabs.bg.even]] -=== tabs.bg.even -Background color of unselected even tabs. - -Default: +pass:[darkgrey]+ - -[[colors-tabs.fg.selected.odd]] -=== tabs.fg.selected.odd -Foreground color of selected odd tabs. - -Default: +pass:[white]+ - -[[colors-tabs.bg.selected.odd]] -=== tabs.bg.selected.odd -Background color of selected odd tabs. - -Default: +pass:[black]+ - -[[colors-tabs.fg.selected.even]] -=== tabs.fg.selected.even -Foreground color of selected even tabs. - -Default: +pass:[${tabs.fg.selected.odd}]+ - -[[colors-tabs.bg.selected.even]] -=== tabs.bg.selected.even -Background color of selected even tabs. - -Default: +pass:[${tabs.bg.selected.odd}]+ - -[[colors-tabs.bg.bar]] -=== tabs.bg.bar -Background color of the tab bar. - -Default: +pass:[#555555]+ - -[[colors-tabs.indicator.start]] -=== tabs.indicator.start -Color gradient start for the tab indicator. - -Default: +pass:[#0000aa]+ - -[[colors-tabs.indicator.stop]] -=== tabs.indicator.stop -Color gradient end for the tab indicator. - -Default: +pass:[#00aa00]+ - -[[colors-tabs.indicator.error]] -=== tabs.indicator.error -Color for the tab indicator on errors.. - -Default: +pass:[#ff0000]+ - -[[colors-tabs.indicator.system]] -=== tabs.indicator.system -Color gradient interpolation system for the tab indicator. +Type: <> Valid values: - * +rgb+: Interpolate in the RGB color system. - * +hsv+: Interpolate in the HSV color system. - * +hsl+: Interpolate in the HSL color system. - * +none+: Don't show a gradient. + * +true+ + * +false+ -Default: +pass:[rgb]+ +Default: empty -[[colors-hints.fg]] -=== hints.fg -Font color for hints. +[[window.title_format]] +=== window.title_format +The format to use for the window title. +The following placeholders are defined: -Default: +pass:[black]+ +* `{perc}`: The percentage as a string like `[10%]`. +* `{perc_raw}`: The raw percentage, e.g. `10` +* `{title}`: The title of the current web page +* `{title_sep}`: The string ` - ` if a title is set, empty otherwise. +* `{id}`: The internal window ID of this window. +* `{scroll_pos}`: The page scroll position. +* `{host}`: The host of the current web page. +* `{backend}`: Either ''webkit'' or ''webengine'' +* `{private}` : Indicates when private mode is enabled. -[[colors-hints.bg]] -=== hints.bg -Background color for hints. Note that you can use a `rgba(...)` value for transparency. -Default: +pass:[qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8))]+ +Type: <> -[[colors-hints.fg.match]] -=== hints.fg.match -Font color for the matched part of hints. +Default: +pass:[{perc}{title}{title_sep}qutebrowser]+ -Default: +pass:[green]+ +[[zoom.default]] +=== zoom.default +The default zoom level. -[[colors-downloads.bg.bar]] -=== downloads.bg.bar -Background color for the download bar. +Type: <> -Default: +pass:[black]+ +Default: +pass:[100%]+ -[[colors-downloads.fg.start]] -=== downloads.fg.start -Color gradient start for download text. +[[zoom.levels]] +=== zoom.levels +The available zoom levels. -Default: +pass:[white]+ +Type: <> -[[colors-downloads.bg.start]] -=== downloads.bg.start -Color gradient start for download backgrounds. +Default: -Default: +pass:[#0000aa]+ +- +pass:[25%]+ +- +pass:[33%]+ +- +pass:[50%]+ +- +pass:[67%]+ +- +pass:[75%]+ +- +pass:[90%]+ +- +pass:[100%]+ +- +pass:[110%]+ +- +pass:[125%]+ +- +pass:[150%]+ +- +pass:[175%]+ +- +pass:[200%]+ +- +pass:[250%]+ +- +pass:[300%]+ +- +pass:[400%]+ +- +pass:[500%]+ -[[colors-downloads.fg.stop]] -=== downloads.fg.stop -Color gradient end for download text. +[[zoom.mouse_divider]] +=== zoom.mouse_divider +How much to divide the mouse wheel movements to translate them into zoom increments. -Default: +pass:[${downloads.fg.start}]+ +Type: <> -[[colors-downloads.bg.stop]] -=== downloads.bg.stop -Color gradient stop for download backgrounds. +Default: +pass:[512]+ -Default: +pass:[#00aa00]+ +[[zoom.text_only]] +=== zoom.text_only +Whether the zoom factor on a frame applies only to the text or to all content. -[[colors-downloads.fg.system]] -=== downloads.fg.system -Color gradient interpolation system for download text. +Type: <> Valid values: - * +rgb+: Interpolate in the RGB color system. - * +hsv+: Interpolate in the HSV color system. - * +hsl+: Interpolate in the HSL color system. - * +none+: Don't show a gradient. - -Default: +pass:[rgb]+ - -[[colors-downloads.bg.system]] -=== downloads.bg.system -Color gradient interpolation system for download backgrounds. - -Valid values: - - * +rgb+: Interpolate in the RGB color system. - * +hsv+: Interpolate in the HSV color system. - * +hsl+: Interpolate in the HSL color system. - * +none+: Don't show a gradient. - -Default: +pass:[rgb]+ - -[[colors-downloads.fg.error]] -=== downloads.fg.error -Foreground color for downloads with errors. - -Default: +pass:[white]+ - -[[colors-downloads.bg.error]] -=== downloads.bg.error -Background color for downloads with errors. - -Default: +pass:[red]+ - -[[colors-webpage.bg]] -=== webpage.bg -Background color for webpages if unset (or empty to use the theme's color) - -Default: +pass:[white]+ - -[[colors-keyhint.fg]] -=== keyhint.fg -Text color for the keyhint widget. - -Default: +pass:[#FFFFFF]+ - -[[colors-keyhint.fg.suffix]] -=== keyhint.fg.suffix -Highlight color for keys to complete the current keychain - -Default: +pass:[#FFFF00]+ - -[[colors-keyhint.bg]] -=== keyhint.bg -Background color of the keyhint widget. - -Default: +pass:[rgba(0, 0, 0, 80%)]+ - -[[colors-messages.fg.error]] -=== messages.fg.error -Foreground color of an error message. - -Default: +pass:[white]+ - -[[colors-messages.bg.error]] -=== messages.bg.error -Background color of an error message. - -Default: +pass:[red]+ - -[[colors-messages.border.error]] -=== messages.border.error -Border color of an error message. - -Default: +pass:[#bb0000]+ - -[[colors-messages.fg.warning]] -=== messages.fg.warning -Foreground color a warning message. - -Default: +pass:[white]+ - -[[colors-messages.bg.warning]] -=== messages.bg.warning -Background color of a warning message. - -Default: +pass:[darkorange]+ - -[[colors-messages.border.warning]] -=== messages.border.warning -Border color of an error message. - -Default: +pass:[#d47300]+ - -[[colors-messages.fg.info]] -=== messages.fg.info -Foreground color an info message. - -Default: +pass:[white]+ - -[[colors-messages.bg.info]] -=== messages.bg.info -Background color of an info message. - -Default: +pass:[black]+ - -[[colors-messages.border.info]] -=== messages.border.info -Border color of an info message. - -Default: +pass:[#333333]+ - -[[colors-prompts.fg]] -=== prompts.fg -Foreground color for prompts. - -Default: +pass:[white]+ - -[[colors-prompts.bg]] -=== prompts.bg -Background color for prompts. - -Default: +pass:[darkblue]+ - -[[colors-prompts.selected.bg]] -=== prompts.selected.bg -Background color for the selected item in filename prompts. - -Default: +pass:[#308cc6]+ - -== fonts -Fonts used for the UI, with optional style/weight/size. - - * Style: `normal`/`italic`/`oblique` - * Weight: `normal`, `bold`, `100`..`900` - * Size: _number_ `px`/`pt` - -[[fonts-_monospace]] -=== _monospace -Default monospace fonts. - -Default: +pass:[xos4 Terminus, Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal]+ - -[[fonts-completion]] -=== completion -Font used in the completion widget. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-completion.category]] -=== completion.category -Font used in the completion categories. - -Default: +pass:[bold ${completion}]+ - -[[fonts-tabbar]] -=== tabbar -Font used in the tab bar. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-statusbar]] -=== statusbar -Font used in the statusbar. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-downloads]] -=== downloads -Font used for the downloadbar. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-hints]] -=== hints -Font used for the hints. - -Default: +pass:[bold 13px ${_monospace}]+ - -[[fonts-debug-console]] -=== debug-console -Font used for the debugging console. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-web-family-standard]] -=== web-family-standard -Font family for standard fonts. + * +true+ + * +false+ Default: empty -[[fonts-web-family-fixed]] -=== web-family-fixed -Font family for fixed fonts. +This setting is only available with the QtWebKit backend. -Default: empty +== Setting types +[[types]] +[options="header",width="75%",cols="25%,75%"] +|============== +|Type|Description +|Bool|A boolean setting, either `true` or `false`. -[[fonts-web-family-serif]] -=== web-family-serif -Font family for serif fonts. +When setting from a string, `1`, `yes`, `on` and `true` count as true, while `0`, `no`, `off` and `false` count as false (case-insensitive). +|BoolAsk|Like `Bool`, but `ask` is allowed as additional value. +|ColorSystem|The color system to use for color interpolation. +|Command|Base class for a command value with arguments. +|ConfirmQuit|Whether to display a confirmation when the window is closed. +|Dict|A dictionary of values. -Default: empty +When setting from a string, pass a json-like dict, e.g. `{"key", "value"}`. +|Directory|A directory on the local filesystem. +|Encoding|Setting for a python encoding. +|File|A file on the local filesystem. +|FlagList|A list of flags. -[[fonts-web-family-sans-serif]] -=== web-family-sans-serif -Font family for sans-serif fonts. +Lists with duplicate flags are invalid. Each item is checked against the valid values of the setting. +|Float|Base class for a float setting. +|Font|A font family, with optional style/weight/size. -Default: empty +* Style: `normal`/`italic`/`oblique` * Weight: `normal`, `bold`, `100`..`900` * Size: _number_ `px`/`pt` +|FontFamily|A Qt font family. +|FormatString|A string with placeholders. +|FuzzyUrl|A URL which gets interpreted as search if needed. +|Int|Base class for an integer setting. +|Key|A name of a key. +|List|A list of values. -[[fonts-web-family-cursive]] -=== web-family-cursive -Font family for cursive fonts. +When setting from a string, pass a json-like list, e.g. `["one", "two"]`. +|NewTabPosition|How new tabs are positioned. +|Padding|Setting for paddings around elements. +|Perc|A percentage. +|PercOrInt|Percentage or integer. +|Position|The position of the tab bar. +|Proxy|A proxy URL, or `system`/`none`. +|QssColor|A color value supporting gradients. -Default: empty +A value can be in one of the following formats: * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` * An SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) * A gradient as explained in http://doc.qt.io/qt-5/stylesheet-reference.html#list-of-property-types[the Qt documentation] under ``Gradient'' +|QtColor|A color value. -[[fonts-web-family-fantasy]] -=== web-family-fantasy -Font family for fantasy fonts. +A value can be in one of the following formats: * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` * An SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) +|QtFont|A font family, with optional style/weight/size. -Default: empty +* Style: `normal`/`italic`/`oblique` * Weight: `normal`, `bold`, `100`..`900` * Size: _number_ `px`/`pt` +|Regex|A regular expression. -[[fonts-web-size-minimum]] -=== web-size-minimum -The hard minimum font size. +When setting from `config.py`, both a string or a `re.compile(...)` object are valid. +|SearchEngineUrl|A search engine URL. +|SelectOnRemove|Which tab to select when the focused tab is removed. +|SessionName|The name of a session. +|ShellCommand|A shell command as a list. -Default: +pass:[0]+ +See the documentation for `List`. +|String|A string value. -[[fonts-web-size-minimum-logical]] -=== web-size-minimum-logical -The minimum logical font size that is applied when zooming out. +See the setting's valid values for more information on allowed values. +|TextAlignment|Alignment of text. +|TimestampTemplate|An strftime-like template for timestamps. -Default: +pass:[6]+ - -[[fonts-web-size-default]] -=== web-size-default -The default font size for regular text. - -Default: +pass:[16]+ - -[[fonts-web-size-default-fixed]] -=== web-size-default-fixed -The default font size for fixed-pitch text. - -Default: +pass:[13]+ - -[[fonts-keyhint]] -=== keyhint -Font used in the keyhint widget. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-messages.error]] -=== messages.error -Font used for error messages. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-messages.warning]] -=== messages.warning -Font used for warning messages. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-messages.info]] -=== messages.info -Font used for info messages. - -Default: +pass:[8pt ${_monospace}]+ - -[[fonts-prompts]] -=== prompts -Font used for prompts. - -Default: +pass:[8pt sans-serif]+ +See https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior for reference. +|UniqueCharString|A string which may not contain duplicate chars. +|Url|A URL as a string. +|VerticalPosition|The position of the download bar. +|============== diff --git a/doc/qutebrowser.1.asciidoc b/doc/qutebrowser.1.asciidoc index 1b8345b0c..58744e75d 100644 --- a/doc/qutebrowser.1.asciidoc +++ b/doc/qutebrowser.1.asciidoc @@ -44,7 +44,7 @@ show it. *-V*, *--version*:: Show version and quit. -*-s* 'SECTION' 'OPTION' 'VALUE', *--set* 'SECTION' 'OPTION' 'VALUE':: +*-s* 'OPTION' 'VALUE', *--set* 'OPTION' 'VALUE':: Set a temporary setting for this session. *-r* 'SESSION', *--restore* 'SESSION':: diff --git a/misc/qutebrowser.spec b/misc/qutebrowser.spec index cd0ce3883..bcbd67405 100644 --- a/misc/qutebrowser.spec +++ b/misc/qutebrowser.spec @@ -15,7 +15,8 @@ def get_data_files(): ('../qutebrowser/img', 'img'), ('../qutebrowser/javascript', 'javascript'), ('../qutebrowser/html/doc', 'html/doc'), - ('../qutebrowser/git-commit-id', '') + ('../qutebrowser/git-commit-id', ''), + ('../qutebrowser/config/configdata.yml', 'config'), ] # if os.path.exists(os.path.join('qutebrowser', '3rdparty', 'pdfjs')): diff --git a/misc/userscripts/dmenu_qutebrowser b/misc/userscripts/dmenu_qutebrowser index 6917dae98..9c809d5ad 100755 --- a/misc/userscripts/dmenu_qutebrowser +++ b/misc/userscripts/dmenu_qutebrowser @@ -23,7 +23,7 @@ # If run from qutebrowser as a userscript, it runs :open on the URL # If not, it opens a new qutebrowser window at the URL # -# Ideal for use with tabs-are-windows. Set a hotkey to launch this script, then: +# Ideal for use with tabs_are_windows. Set a hotkey to launch this script, then: # :bind o spawn --userscript dmenu_qutebrowser # # Use the hotkey to open in new tab/window, press 'o' to open URL in current tab/window diff --git a/misc/userscripts/open_download b/misc/userscripts/open_download index 54c9d3e97..6c1213b65 100755 --- a/misc/userscripts/open_download +++ b/misc/userscripts/open_download @@ -12,7 +12,7 @@ # - rofi (in a recent version) # - xdg-open and xdg-mime # - You should configure qutebrowser to download files to a single directory -# - It comes in handy if you enable remove-finished-downloads. If you want to +# - It comes in handy if you enable downloads.remove_finished. If you want to # see the recent downloads, just press "sd". # # Thorsten Wißmann, 2015 (thorsten` on freenode) diff --git a/misc/userscripts/openfeeds b/misc/userscripts/openfeeds index 8bc4c2d33..4a1a942e6 100755 --- a/misc/userscripts/openfeeds +++ b/misc/userscripts/openfeeds @@ -21,7 +21,7 @@ # Opens all links to feeds defined in the head of a site # -# Ideal for use with tabs-are-windows. Set a hotkey to launch this script, then: +# Ideal for use with tabs_are_windows. Set a hotkey to launch this script, then: # :bind gF spawn --userscript openfeeds # # Use the hotkey to open the feeds in new tab/window, press 'gF' to open diff --git a/pytest.ini b/pytest.ini index 40b11614e..5401eaacc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -15,6 +15,7 @@ markers = end2end: End to end tests which run qutebrowser as subprocess xfail_norun: xfail the test with out running it ci: Tests which should only run on CI. + no_ci: Tests which should not run on CI. qtwebengine_todo: Features still missing with QtWebEngine qtwebengine_skip: Tests not applicable with QtWebEngine qtwebkit_skip: Tests not applicable with QtWebKit @@ -26,6 +27,7 @@ markers = this: Used to mark tests during development no_invalid_lines: Don't fail on unparseable lines in end2end tests issue2478: Tests which are broken on Windows with QtWebEngine, https://github.com/qutebrowser/qutebrowser/issues/2478 + qt55: Tests only running on Qt 5.5 or later qt_log_level_fail = WARNING qt_log_ignore = ^SpellCheck: .* @@ -50,7 +52,8 @@ qt_log_ignore = ^Error when parsing the netrc file ^Image of format '' blocked because it is not considered safe. If you are sure it is safe to do so, you can white-list the format by setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST= ^QPainter::end: Painter ended with \d+ saved states - ^QSslSocket: cannot resolve SSLv[23]_(client|server)_method + ^QSslSocket: cannot resolve * + ^Incompatible version of OpenSSL ^QQuickWidget::invalidateRenderControl could not make context current ^libpng warning: iCCP: known incorrect sRGB profile xfail_strict = true diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 51cacfac7..5c9a682e2 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -22,7 +22,6 @@ import os import sys import subprocess -import configparser import functools import json import shutil @@ -44,8 +43,7 @@ import qutebrowser import qutebrowser.resources from qutebrowser.completion.models import miscmodels from qutebrowser.commands import cmdutils, runners, cmdexc -from qutebrowser.config import style, config, websettings, configexc -from qutebrowser.config.parsers import keyconf +from qutebrowser.config import config, websettings, configexc from qutebrowser.browser import (urlmarks, adblock, history, browsertab, downloads) from qutebrowser.browser.network import proxy @@ -54,7 +52,7 @@ from qutebrowser.browser.webkit.network import networkmanager from qutebrowser.keyinput import macros from qutebrowser.mainwindow import mainwindow, prompt from qutebrowser.misc import (readline, ipc, savemanager, sessions, - crashsignal, earlyinit, objects, sql) + crashsignal, earlyinit, objects, sql, cmdhistory) from qutebrowser.misc import utilcmds # pylint: disable=unused-import from qutebrowser.utils import (log, version, message, utils, qtutils, urlutils, objreg, usertypes, standarddir, error) @@ -148,8 +146,6 @@ def init(args, crash_handler): objreg.register('event-filter', event_filter) log.init.debug("Connecting signals...") - config_obj = objreg.get('config') - config_obj.style_changed.connect(style.get_stylesheet.cache_clear) qApp.focusChanged.connect(on_focus_changed) _process_args(args) @@ -184,11 +180,10 @@ def _init_icon(): def _process_args(args): """Open startpage etc. and process commandline args.""" - config_obj = objreg.get('config') - for sect, opt, val in args.temp_settings: + for opt, val in args.temp_settings: try: - config_obj.set('temp', sect, opt, val) - except (configexc.Error, configparser.Error) as e: + config.instance.set_str(opt, val) + except configexc.Error as e: message.error("set: {} - {}".format(e.__class__.__name__, e)) if not args.override_restore: @@ -274,7 +269,7 @@ def process_pos_args(args, via_ipc=False, cwd=None, target_arg=None): if via_ipc and target_arg and target_arg != 'auto': open_target = target_arg else: - open_target = config.get('general', 'new-instance-open-target') + open_target = config.val.new_instance_open_target win_id = mainwindow.get_window(via_ipc, force_target=open_target) tabbed_browser = objreg.get('tabbed-browser', scope='window', window=win_id) @@ -289,7 +284,7 @@ def process_pos_args(args, via_ipc=False, cwd=None, target_arg=None): else: background = open_target in ['tab-bg', 'tab-bg-silent'] tabbed_browser.tabopen(url, background=background, - explicit=True) + related=False) def _open_startpage(win_id=None): @@ -309,15 +304,9 @@ def _open_startpage(win_id=None): tabbed_browser = objreg.get('tabbed-browser', scope='window', window=cur_win_id) if tabbed_browser.count() == 0: - log.init.debug("Opening startpage") - for urlstr in config.get('general', 'startpage'): - try: - url = urlutils.fuzzy_url(urlstr, do_search=False) - except urlutils.InvalidUrlError as e: - message.error("Error when opening startpage: {}".format(e)) - tabbed_browser.tabopen(QUrl('about:blank')) - else: - tabbed_browser.tabopen(url) + log.init.debug("Opening start pages") + for url in config.val.url.start_pages: + tabbed_browser.tabopen(url) def _open_special_pages(args): @@ -335,6 +324,7 @@ def _open_special_pages(args): return state_config = objreg.get('state-config') + general_sect = state_config['general'] tabbed_browser = objreg.get('tabbed-browser', scope='window', window='last-focused') @@ -342,21 +332,32 @@ def _open_special_pages(args): needs_warning = (objects.backend == usertypes.Backend.QtWebKit and not qtutils.is_qtwebkit_ng()) - warning_shown = state_config['general'].get('backend-warning-shown') == '1' + warning_shown = general_sect.get('backend-warning-shown') == '1' if not warning_shown and needs_warning: tabbed_browser.tabopen(QUrl('qute://backend-warning'), background=False) - state_config['general']['backend-warning-shown'] = '1' + general_sect['backend-warning-shown'] = '1' # Quickstart page - quickstart_done = state_config['general'].get('quickstart-done') == '1' + quickstart_done = general_sect.get('quickstart-done') == '1' if not quickstart_done: tabbed_browser.tabopen( QUrl('https://www.qutebrowser.org/quickstart.html')) - state_config['general']['quickstart-done'] = '1' + general_sect['quickstart-done'] = '1' + + # Setting migration page + + needs_migration = os.path.exists( + os.path.join(standarddir.config(), 'qutebrowser.conf')) + migration_shown = general_sect.get('config-migration-shown') == '1' + + if needs_migration and not migration_shown: + tabbed_browser.tabopen(QUrl('qute://help/configuring.html'), + background=False) + general_sect['config-migration-shown'] = '1' def _save_version(): @@ -422,9 +423,6 @@ def _init_modules(args, crash_handler): config.init(qApp) save_manager.init_autosave() - log.init.debug("Initializing keys...") - keyconf.init(qApp) - log.init.debug("Initializing sql...") try: sql.init(os.path.join(standarddir.data(), 'history.sqlite')) @@ -433,6 +431,9 @@ def _init_modules(args, crash_handler): pre_text='Error initializing SQL') sys.exit(usertypes.Exit.err_init) + log.init.debug("Initializing command history...") + cmdhistory.init() + log.init.debug("Initializing web history...") history.init(qApp) @@ -470,7 +471,7 @@ def _init_modules(args, crash_handler): objreg.register('cache', diskcache) log.init.debug("Misc initialization...") - if config.get('ui', 'hide-wayland-decoration'): + if config.val.window.hide_wayland_decoration: os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' else: os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) @@ -640,8 +641,25 @@ class Quitter: else: return True - @cmdutils.register(instance='quitter', name=['quit', 'q'], - ignore_args=True) + @cmdutils.register(instance='quitter', name='quit') + @cmdutils.argument('session', completion=miscmodels.session) + def quit(self, save=False, session=None): + """Quit qutebrowser. + + Args: + save: When given, save the open windows even if auto_save.session + is turned off. + session: The name of the session to save. + """ + if session is not None and not save: + raise cmdexc.CommandError("Session name given without --save!") + if save: + if session is None: + session = sessions.default + self.shutdown(session=session) + else: + self.shutdown() + def shutdown(self, status=0, session=None, last_window=False, restart=False): """Quit qutebrowser. @@ -663,7 +681,7 @@ class Quitter: if session is not None: session_manager.save(session, last_window=last_window, load_next_time=True) - elif config.get('general', 'save-session'): + elif config.val.auto_save.session: session_manager.save(sessions.default, last_window=last_window, load_next_time=True) @@ -742,16 +760,6 @@ class Quitter: # segfaults. QTimer.singleShot(0, functools.partial(qApp.exit, status)) - @cmdutils.register(instance='quitter', name='wq') - @cmdutils.argument('name', completion=miscmodels.session) - def save_and_quit(self, name=sessions.default): - """Save open pages and quit. - - Args: - name: The name of the session. - """ - self.shutdown(session=name) - class Application(QApplication): diff --git a/qutebrowser/browser/adblock.py b/qutebrowser/browser/adblock.py index 276dec08b..623d15717 100644 --- a/qutebrowser/browser/adblock.py +++ b/qutebrowser/browser/adblock.py @@ -67,11 +67,7 @@ def is_whitelisted_host(host): Args: host: The host of the request as string. """ - whitelist = config.get('content', 'host-blocking-whitelist') - if whitelist is None: - return False - - for pattern in whitelist: + for pattern in config.val.content.host_blocking.whitelist: if fnmatch.fnmatch(host, pattern.lower()): return True return False @@ -114,16 +110,16 @@ class HostBlocker: data_dir = standarddir.data() self._local_hosts_file = os.path.join(data_dir, 'blocked-hosts') - self.on_config_changed() + self._update_files() config_dir = standarddir.config() self._config_hosts_file = os.path.join(config_dir, 'blocked-hosts') - objreg.get('config').changed.connect(self.on_config_changed) + config.instance.changed.connect(self._update_files) def is_blocked(self, url): """Check if the given URL (as QUrl) is blocked.""" - if not config.get('content', 'host-blocking-enabled'): + if not config.val.content.host_blocking.enabled: return False host = url.host() return ((host in self._blocked_hosts or @@ -164,9 +160,9 @@ class HostBlocker: if not found: args = objreg.get('args') - if (config.get('content', 'host-block-lists') is not None and + if (config.val.content.host_blocking.lists and args.basedir is None and - config.get('content', 'host-blocking-enabled')): + config.val.content.host_blocking.enabled): message.info("Run :adblock-update to get adblock lists.") @cmdutils.register(instance='host-blocker') @@ -180,18 +176,16 @@ class HostBlocker: self._config_blocked_hosts) self._blocked_hosts = set() self._done_count = 0 - urls = config.get('content', 'host-block-lists') download_manager = objreg.get('qtnetwork-download-manager', scope='window', window='last-focused') - if urls is None: - return - for url in urls: + for url in config.val.content.host_blocking.lists: if url.scheme() == 'file': + filename = url.toLocalFile() try: - fileobj = open(url.path(), 'rb') + fileobj = open(filename, 'rb') except OSError as e: message.error("adblock: Error while reading {}: {}".format( - url.path(), e.strerror)) + filename, e.strerror)) continue download = FakeDownload(fileobj) self._in_progress.append(download) @@ -292,11 +286,10 @@ class HostBlocker: message.info("adblock: Read {} hosts from {} sources.".format( len(self._blocked_hosts), self._done_count)) - @config.change_filter('content', 'host-block-lists') - def on_config_changed(self): + @config.change_filter('content.host_blocking.lists') + def _update_files(self): """Update files when the config changed.""" - urls = config.get('content', 'host-block-lists') - if urls is None: + if not config.val.content.host_blocking.lists: try: os.remove(self._local_hosts_file) except FileNotFoundError: diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index b94172118..60b5b3b31 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -61,9 +61,6 @@ def init(): if objects.backend == usertypes.Backend.QtWebEngine: from qutebrowser.browser.webengine import webenginetab webenginetab.init() - else: - from qutebrowser.browser.webkit import webkittab - webkittab.init() class WebTabError(Exception): @@ -188,13 +185,28 @@ class AbstractSearch(QObject): self.text = None self.search_displayed = False - def search(self, text, *, ignore_case=False, reverse=False, + def _is_case_sensitive(self, ignore_case): + """Check if case-sensitivity should be used. + + This assumes self.text is already set properly. + + Arguments: + ignore_case: The ignore_case value from the config. + """ + mapping = { + 'smart': not self.text.islower(), + 'never': True, + 'always': False, + } + return mapping[ignore_case] + + def search(self, text, *, ignore_case='never', reverse=False, result_cb=None): """Find the given text on the page. Args: text: The text to search for. - ignore_case: Search case-insensitively. (True/False/'smart') + ignore_case: Search case-insensitively. ('always'/'never/'smart') reverse: Reverse search direction. result_cb: Called with a bool indicating whether a match was found. """ @@ -236,7 +248,7 @@ class AbstractZoom(QObject): self._win_id = win_id self._default_zoom_changed = False self._init_neighborlist() - objreg.get('config').changed.connect(self._on_config_changed) + config.instance.changed.connect(self._on_config_changed) # # FIXME:qtwebengine is this needed? # # For some reason, this signal doesn't get disconnected automatically @@ -245,21 +257,21 @@ class AbstractZoom(QObject): # self.destroyed.connect(functools.partial( # cfg.changed.disconnect, self.init_neighborlist)) - @pyqtSlot(str, str) - def _on_config_changed(self, section, option): - if section == 'ui' and option in ['zoom-levels', 'default-zoom']: + @pyqtSlot(str) + def _on_config_changed(self, option): + if option in ['zoom.levels', 'zoom.default']: if not self._default_zoom_changed: - factor = float(config.get('ui', 'default-zoom')) / 100 + factor = float(config.val.zoom.default) / 100 self._set_factor_internal(factor) self._default_zoom_changed = False self._init_neighborlist() def _init_neighborlist(self): """Initialize self._neighborlist.""" - levels = config.get('ui', 'zoom-levels') + levels = config.val.zoom.levels self._neighborlist = usertypes.NeighborList( levels, mode=usertypes.NeighborList.Modes.edge) - self._neighborlist.fuzzyval = config.get('ui', 'default-zoom') + self._neighborlist.fuzzyval = config.val.zoom.default def offset(self, offset): """Increase/Decrease the zoom level by the given offset. @@ -295,8 +307,7 @@ class AbstractZoom(QObject): raise NotImplementedError def set_default(self): - default_zoom = config.get('ui', 'default-zoom') - self._set_factor_internal(float(default_zoom) / 100) + self._set_factor_internal(float(config.val.zoom.default) / 100) class AbstractCaret(QObject): @@ -705,8 +716,8 @@ class AbstractTab(QWidget): self.load_started.emit() def _handle_auto_insert_mode(self, ok): - """Handle auto-insert-mode after loading finished.""" - if not config.get('input', 'auto-insert-mode') or not ok: + """Handle `input.insert_mode.auto_load` after loading finished.""" + if not config.val.input.insert_mode.auto_load or not ok: return cur_mode = self._mode_manager.mode diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 1f6994225..79a8502cd 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -34,7 +34,7 @@ import pygments.lexers import pygments.formatters from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners -from qutebrowser.config import config, configexc +from qutebrowser.config import config, configdata from qutebrowser.browser import (urlmarks, browsertab, inspector, navigate, webelem, downloads) from qutebrowser.keyinput import modeman @@ -111,7 +111,7 @@ class CommandDispatcher: return widget def _open(self, url, tab=False, background=False, window=False, - explicit=True, private=None): + related=False, private=None): """Helper function to open a page. Args: @@ -132,9 +132,9 @@ class CommandDispatcher: tabbed_browser = self._new_tabbed_browser(private) tabbed_browser.tabopen(url) elif tab: - tabbed_browser.tabopen(url, background=False, explicit=explicit) + tabbed_browser.tabopen(url, background=False, related=related) elif background: - tabbed_browser.tabopen(url, background=True, explicit=explicit) + tabbed_browser.tabopen(url, background=True, related=related) else: widget = self._current_widget() widget.openurl(url) @@ -179,7 +179,7 @@ class CommandDispatcher: prev: Force selecting the tab before the current tab. next_: Force selecting the tab after the current tab. opposite: Force selecting the tab in the opposite direction of - what's configured in 'tabs->select-on-remove'. + what's configured in 'tabs.select_on_remove'. Return: QTabBar.SelectLeftTab, QTabBar.SelectRightTab, or None if no change @@ -191,17 +191,17 @@ class CommandDispatcher: elif next_: return QTabBar.SelectRightTab elif opposite: - conf_selection = config.get('tabs', 'select-on-remove') + conf_selection = config.val.tabs.select_on_remove if conf_selection == QTabBar.SelectLeftTab: return QTabBar.SelectRightTab elif conf_selection == QTabBar.SelectRightTab: return QTabBar.SelectLeftTab elif conf_selection == QTabBar.SelectPreviousTab: raise cmdexc.CommandError( - "-o is not supported with 'tabs->select-on-remove' set to " + "-o is not supported with 'tabs.select_on_remove' set to " "'last-used'!") else: # pragma: no cover - raise ValueError("Invalid select-on-remove value " + raise ValueError("Invalid select_on_remove value " "{!r}!".format(conf_selection)) return None @@ -213,7 +213,7 @@ class CommandDispatcher: prev: Force selecting the tab before the current tab. next_: Force selecting the tab after the current tab. opposite: Force selecting the tab in the opposite direction of - what's configured in 'tabs->select-on-remove'. + what's configured in 'tabs.select_on_remove'. count: The tab index to close, or None """ tabbar = self._tabbed_browser.tabBar() @@ -238,7 +238,7 @@ class CommandDispatcher: prev: Force selecting the tab before the current tab. next_: Force selecting the tab after the current tab. opposite: Force selecting the tab in the opposite direction of - what's configured in 'tabs->select-on-remove'. + what's configured in 'tabs.select_on_remove'. force: Avoid confirmation for pinned tabs. count: The tab index to close, or None """ @@ -256,7 +256,7 @@ class CommandDispatcher: def tab_pin(self, count=None): """Pin/Unpin the current/[count]th tab. - Pinning a tab shrinks it to tabs->pinned-width size. + Pinning a tab shrinks it to `tabs.width.pinned` size. Attempting to close a pinned tab will cause a confirmation, unless --force is passed. @@ -274,7 +274,7 @@ class CommandDispatcher: maxsplit=0, scope='window') @cmdutils.argument('url', completion=urlmodel.url) @cmdutils.argument('count', count=True) - def openurl(self, url=None, implicit=False, + def openurl(self, url=None, related=False, bg=False, tab=False, window=False, count=None, secure=False, private=False): """Open a URL in the current/[count]th tab. @@ -286,14 +286,14 @@ class CommandDispatcher: bg: Open in a new background tab. tab: Open in a new tab. window: Open in a new window. - implicit: If opening a new tab, treat the tab as implicit (like - clicking on a link). + related: If opening a new tab, position the tab as related to the + current one (like clicking on a link). count: The tab index to open the URL in, or None. secure: Force HTTPS. private: Open a new window in private browsing mode. """ if url is None: - urls = [config.get('general', 'default-page')] + urls = [config.val.url.default_page] else: urls = self._parse_url_input(url) @@ -305,7 +305,7 @@ class CommandDispatcher: bg = True if tab or bg or window or private: - self._open(cur_url, tab, bg, window, explicit=not implicit, + self._open(cur_url, tab, bg, window, related=related, private=private) else: curtab = self._cntwidget(count) @@ -490,7 +490,7 @@ class CommandDispatcher: raise cmdexc.CommandError(e) # The new tab could be in a new tabbed_browser (e.g. because of - # tabs-are-windows being set) + # tabs.tabs_are_windows being set) if window: new_tabbed_browser = self._new_tabbed_browser( private=self._tabbed_browser.private) @@ -502,9 +502,9 @@ class CommandDispatcher: idx = new_tabbed_browser.indexOf(newtab) new_tabbed_browser.set_page_title(idx, cur_title) - if config.get('tabs', 'show-favicons'): + if config.val.tabs.favicons.show: new_tabbed_browser.setTabIcon(idx, curtab.icon()) - if config.get('tabs', 'tabs-are-windows'): + if config.val.tabs.tabs_are_windows: new_tabbed_browser.window().setWindowIcon(curtab.icon()) newtab.data.keep_icon = True @@ -622,7 +622,7 @@ class CommandDispatcher: tab=tab, background=bg, window=window) elif where in ['up', 'increment', 'decrement']: new_url = handlers[where](url, count) - self._open(new_url, tab, bg, window, explicit=False) + self._open(new_url, tab, bg, window, related=True) else: # pragma: no cover raise ValueError("Got called with invalid value {} for " "`where'.".format(where)) @@ -771,7 +771,7 @@ class CommandDispatcher: url_query.setQueryDelimiters('=', ';') url_query.setQuery(url_query_str) for key in dict(url_query.queryItems()): - if key in config.get('general', 'yank-ignored-url-parameters'): + if key in config.val.url.yank_ignored_parameters: url_query.removeQueryItem(key) url.setQuery(url_query) return url.toString(flags) @@ -842,7 +842,7 @@ class CommandDispatcher: perc = tab.zoom.offset(count) except ValueError as e: raise cmdexc.CommandError(e) - message.info("Zoom level: {}%".format(perc), replace=True) + message.info("Zoom level: {}%".format(int(perc)), replace=True) @cmdutils.register(instance='command-dispatcher', scope='window') @cmdutils.argument('count', count=True) @@ -857,7 +857,7 @@ class CommandDispatcher: perc = tab.zoom.offset(-count) except ValueError as e: raise cmdexc.CommandError(e) - message.info("Zoom level: {}%".format(perc), replace=True) + message.info("Zoom level: {}%".format(int(perc)), replace=True) @cmdutils.register(instance='command-dispatcher', scope='window') @cmdutils.argument('count', count=True) @@ -881,14 +881,14 @@ class CommandDispatcher: level = count if count is not None else zoom if level is None: - level = config.get('ui', 'default-zoom') + level = config.val.zoom.default tab = self._current_widget() try: tab.zoom.set_factor(float(level) / 100) except ValueError: raise cmdexc.CommandError("Can't zoom {}%!".format(level)) - message.info("Zoom level: {}%".format(level), replace=True) + message.info("Zoom level: {}%".format(int(level)), replace=True) @cmdutils.register(instance='command-dispatcher', scope='window') def tab_only(self, prev=False, next_=False, force=False): @@ -947,7 +947,7 @@ class CommandDispatcher: newidx = self._current_index() - count if newidx >= 0: self._set_current_index(newidx) - elif config.get('tabs', 'wrap'): + elif config.val.tabs.wrap: self._set_current_index(newidx % self._count()) else: raise cmdexc.CommandError("First tab") @@ -967,7 +967,7 @@ class CommandDispatcher: newidx = self._current_index() + count if newidx < self._count(): self._set_current_index(newidx) - elif config.get('tabs', 'wrap'): + elif config.val.tabs.wrap: self._set_current_index(newidx % self._count()) else: raise cmdexc.CommandError("Last tab") @@ -1124,7 +1124,7 @@ class CommandDispatcher: elif index == '+': # pragma: no branch new_idx += delta - if config.get('tabs', 'wrap'): + if config.val.tabs.wrap: new_idx %= self._count() else: # absolute moving @@ -1186,7 +1186,7 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', scope='window') def home(self): """Open main startpage in current tab.""" - self.openurl(config.get('general', 'startpage')[0]) + self._current_widget().openurl(config.val.url.start_pages[0]) def _run_userscript(self, cmd, *args, verbose=False): """Run a userscript given as argument. @@ -1532,7 +1532,7 @@ class CommandDispatcher: topic: The topic to show help for. - :__command__ for commands. - - __section__\->__option__ for settings. + - __section__.__option__ for settings. """ if topic is None: path = 'index.html' @@ -1542,20 +1542,8 @@ class CommandDispatcher: raise cmdexc.CommandError("Invalid command {}!".format( command)) path = 'commands.html#{}'.format(command) - elif '->' in topic: - parts = topic.split('->') - if len(parts) != 2: - raise cmdexc.CommandError("Invalid help topic {}!".format( - topic)) - try: - config.get(*parts) - except configexc.NoSectionError: - raise cmdexc.CommandError("Invalid section {}!".format( - parts[0])) - except configexc.NoOptionError: - raise cmdexc.CommandError("Invalid option {}!".format( - parts[1])) - path = 'settings.html#{}'.format(topic.replace('->', '-')) + elif topic in configdata.DATA: + path = 'settings.html#{}'.format(topic) else: raise cmdexc.CommandError("Invalid help topic {}!".format(topic)) url = QUrl('qute://help/{}'.format(path)) @@ -1608,7 +1596,7 @@ class CommandDispatcher: """Open an external editor with the currently selected form field. The editor which should be launched can be configured via the - `general -> editor` config option. + `editor.command` config option. """ tab = self._current_widget() tab.elements.find_focused(self._open_editor_cb) @@ -1749,7 +1737,7 @@ class CommandDispatcher: return options = { - 'ignore_case': config.get('general', 'ignore-case'), + 'ignore_case': config.val.ignore_case, 'reverse': reverse, } @@ -2103,7 +2091,7 @@ class CommandDispatcher: """Navigate to a url formed in an external editor. The editor which should be launched can be configured via the - `general -> editor` config option. + `editor.command` config option. Args: url: URL to edit; defaults to the current page url. diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 438dfc528..9458e39d0 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -69,15 +69,22 @@ class UnsupportedOperationError(Exception): def download_dir(): """Get the download directory to use.""" - directory = config.get('storage', 'download-directory') - remember_dir = config.get('storage', 'remember-download-directory') + directory = config.val.downloads.location.directory + remember_dir = config.val.downloads.location.remember if remember_dir and last_used_directory is not None: - return last_used_directory + ddir = last_used_directory elif directory is None: - return standarddir.download() + ddir = standarddir.download() else: - return directory + ddir = directory + + try: + os.makedirs(ddir) + except FileExistsError: + pass + + return ddir def immediate_download_path(prompt_download_directory=None): @@ -88,11 +95,10 @@ def immediate_download_path(prompt_download_directory=None): Args: prompt_download_directory: If this is something else than None, it will overwrite the - storage->prompt-download-directory setting. + downloads.location.prompt setting. """ if prompt_download_directory is None: - prompt_download_directory = config.get('storage', - 'prompt-download-directory') + prompt_download_directory = config.val.downloads.location.prompt if not prompt_download_directory: return download_dir() @@ -104,7 +110,7 @@ def _path_suggestion(filename): Args: filename: The filename to use if included in the suggestion. """ - suggestion = config.get('completion', 'download-path-suggestion') + suggestion = config.val.downloads.location.suggestion if suggestion == 'path': # add trailing '/' if not present return os.path.join(download_dir(), '') @@ -494,13 +500,13 @@ class AbstractDownloadItem(QObject): Args: position: The color type requested, can be 'fg' or 'bg'. """ - # pylint: disable=bad-config-call - # WORKAROUND for https://bitbucket.org/logilab/astroid/issue/104/ assert position in ["fg", "bg"] - start = config.get('colors', 'downloads.{}.start'.format(position)) - stop = config.get('colors', 'downloads.{}.stop'.format(position)) - system = config.get('colors', 'downloads.{}.system'.format(position)) - error = config.get('colors', 'downloads.{}.error'.format(position)) + # pylint: disable=bad-config-option + start = getattr(config.val.colors.downloads.start, position) + stop = getattr(config.val.colors.downloads.stop, position) + system = getattr(config.val.colors.downloads.system, position) + error = getattr(config.val.colors.downloads.error, position) + # pylint: enable=bad-config-option if self.error_msg is not None: assert not self.successful return error @@ -572,7 +578,7 @@ class AbstractDownloadItem(QObject): Args: cmdline: The command to use as string. A `{}` is expanded to the filename. None means to use the system's default - application or `default-open-dispatcher` if set. If no + application or `downloads.open_dispatcher` if set. If no `{}` is found, the filename is appended to the cmdline. """ assert self.successful @@ -757,7 +763,7 @@ class AbstractDownloadManager(QObject): download.remove_requested.connect(functools.partial( self._remove_item, download)) - delay = config.get('ui', 'remove-finished-downloads') + delay = config.val.downloads.remove_finished if delay > -1: download.finished.connect( lambda: QTimer.singleShot(delay, download.remove)) diff --git a/qutebrowser/browser/downloadview.py b/qutebrowser/browser/downloadview.py index 199f4d1d8..ac44d75d9 100644 --- a/qutebrowser/browser/downloadview.py +++ b/qutebrowser/browser/downloadview.py @@ -26,7 +26,7 @@ from PyQt5.QtCore import pyqtSlot, QSize, Qt, QTimer from PyQt5.QtWidgets import QListView, QSizePolicy, QMenu, QStyleFactory from qutebrowser.browser import downloads -from qutebrowser.config import style +from qutebrowser.config import config from qutebrowser.utils import qtutils, utils, objreg @@ -64,8 +64,8 @@ class DownloadView(QListView): STYLESHEET = """ QListView { - background-color: {{ color['downloads.bg.bar'] }}; - font: {{ font['downloads'] }}; + background-color: {{ conf.colors.downloads.bar.bg }}; + font: {{ conf.fonts.downloads }}; } QListView::item { @@ -76,7 +76,7 @@ class DownloadView(QListView): def __init__(self, win_id, parent=None): super().__init__(parent) self.setStyle(QStyleFactory.create('Fusion')) - style.set_register_stylesheet(self) + config.set_register_stylesheet(self) self.setResizeMode(QListView.Adjust) self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 3cc70f434..14a9cd7c2 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -29,7 +29,7 @@ from string import ascii_lowercase from PyQt5.QtCore import pyqtSlot, QObject, Qt, QUrl from PyQt5.QtWidgets import QLabel -from qutebrowser.config import config, style +from qutebrowser.config import config from qutebrowser.keyinput import modeman, modeparsers from qutebrowser.browser import webelem from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners @@ -65,10 +65,10 @@ class HintLabel(QLabel): STYLESHEET = """ QLabel { - background-color: {{ color['hints.bg'] }}; - color: {{ color['hints.fg'] }}; - font: {{ font['hints'] }}; - border: {{ config.get('hints', 'border') }}; + background-color: {{ conf.colors.hints.bg }}; + color: {{ conf.colors.hints.fg }}; + font: {{ conf.fonts.hints }}; + border: {{ conf.hints.border }}; padding-left: -3px; padding-right: -3px; } @@ -80,7 +80,7 @@ class HintLabel(QLabel): self.elem = elem self.setAttribute(Qt.WA_StyledBackground, True) - style.set_register_stylesheet(self) + config.set_register_stylesheet(self) self._context.tab.contents_size_changed.connect(self._move_to_elem) self._move_to_elem() @@ -100,7 +100,7 @@ class HintLabel(QLabel): matched: The part of the text which was typed. unmatched: The part of the text which was not typed yet. """ - if (config.get('hints', 'uppercase') and + if (config.val.hints.uppercase and self._context.hint_mode in ['letter', 'word']): matched = html.escape(matched.upper()) unmatched = html.escape(unmatched.upper()) @@ -108,7 +108,7 @@ class HintLabel(QLabel): matched = html.escape(matched) unmatched = html.escape(unmatched) - match_color = html.escape(config.get('colors', 'hints.fg.match')) + match_color = html.escape(config.val.colors.hints.match.fg) self.setText('{}{}'.format( match_color, matched, unmatched)) self.adjustSize() @@ -121,7 +121,7 @@ class HintLabel(QLabel): log.hints.debug("Frame for {!r} vanished!".format(self)) self.hide() return - no_js = config.get('hints', 'find-implementation') != 'javascript' + no_js = config.val.hints.find_implementation != 'javascript' rect = self.elem.rect_on_view(no_js=no_js) self.move(rect.x(), rect.y()) @@ -203,7 +203,7 @@ class HintActions: Target.window: usertypes.ClickTarget.window, Target.hover: usertypes.ClickTarget.normal, } - if config.get('tabs', 'background-tabs'): + if config.val.tabs.background: target_mapping[Target.tab] = usertypes.ClickTarget.tab_bg else: target_mapping[Target.tab] = usertypes.ClickTarget.tab @@ -421,9 +421,9 @@ class HintManager(QObject): if hint_mode == 'number': chars = '0123456789' else: - chars = config.get('hints', 'chars') - min_chars = config.get('hints', 'min-chars') - if config.get('hints', 'scatter') and hint_mode != 'number': + chars = config.val.hints.chars + min_chars = config.val.hints.min_chars + if config.val.hints.scatter and hint_mode != 'number': return self._hint_scattered(min_chars, chars, elems) else: return self._hint_linear(min_chars, chars, elems) @@ -603,7 +603,7 @@ class HintManager(QObject): modeman.enter(self._win_id, usertypes.KeyMode.hint, 'HintManager.start') - # to make auto-follow == 'always' work + # to make auto_follow == 'always' work self._handle_auto_follow() @cmdutils.register(instance='hintmanager', scope='tab', name='hint', @@ -615,7 +615,7 @@ class HintManager(QObject): Args: rapid: Whether to do rapid hinting. This is only possible with - targets `tab` (with background-tabs=true), `tab-bg`, + targets `tab` (with `tabs.background_tabs=true`), `tab-bg`, `window`, `run`, `hover`, `userscript` and `spawn`. add_history: Whether to add the spawned or yanked link to the browsing history. @@ -631,7 +631,7 @@ class HintManager(QObject): - `normal`: Open the link. - `current`: Open the link in the current tab. - `tab`: Open the link in a new tab (honoring the - background-tabs setting). + `tabs.background_tabs` setting). - `tab-fg`: Open the link in a new foreground tab. - `tab-bg`: Open the link in a new background tab. - `window`: Open the link in a new window. @@ -649,7 +649,7 @@ class HintManager(QObject): mode: The hinting mode to use. - `number`: Use numeric hints. - - `letter`: Use the chars in the hints->chars settings. + - `letter`: Use the chars in the hints.chars setting. - `word`: Use hint words based on the html elements and the extra words. @@ -684,8 +684,7 @@ class HintManager(QObject): Target.hover, Target.userscript, Target.spawn, Target.download, Target.normal, Target.current]: pass - elif (target == Target.tab and - config.get('tabs', 'background-tabs')): + elif target == Target.tab and config.val.tabs.background: pass else: name = target.name.replace('_', '-') @@ -693,7 +692,7 @@ class HintManager(QObject): "target {}!".format(name)) if mode is None: - mode = config.get('hints', 'mode') + mode = config.val.hints.mode self._check_args(target, *args) self._context = HintContext() @@ -720,7 +719,7 @@ class HintManager(QObject): return self._context.hint_mode def _handle_auto_follow(self, keystr="", filterstr="", visible=None): - """Handle the auto-follow option.""" + """Handle the auto_follow option.""" if visible is None: visible = {string: label for string, label in self._context.labels.items() @@ -729,7 +728,7 @@ class HintManager(QObject): if len(visible) != 1: return - auto_follow = config.get('hints', 'auto-follow') + auto_follow = config.val.hints.auto_follow if auto_follow == "always": follow = True @@ -746,8 +745,8 @@ class HintManager(QObject): self._context.to_follow = list(visible.keys())[0] if follow: - # apply auto-follow-timeout - timeout = config.get('hints', 'auto-follow-timeout') + # apply auto_follow_timeout + timeout = config.val.hints.auto_follow_timeout keyparsers = objreg.get('keyparsers', scope='window', window=self._win_id) normal_parser = keyparsers[usertypes.KeyMode.normal] @@ -771,9 +770,9 @@ class HintManager(QObject): label.show() else: # element doesn't match anymore -> hide it, unless in rapid - # mode and hide-unmatched-rapid-hints is false (see #1799) + # mode and hide_unmatched_rapid_hints is false (see #1799) if (not self._context.rapid or - config.get('hints', 'hide-unmatched-rapid-hints')): + config.val.hints.hide_unmatched_rapid_hints): label.hide() except webelem.Error: pass @@ -793,6 +792,8 @@ class HintManager(QObject): else: self._context.filterstr = filterstr + log.hints.debug("Filtering hints on {!r}".format(filterstr)) + visible = [] for label in self._context.all_labels: try: @@ -938,7 +939,7 @@ class WordHinter: def ensure_initialized(self): """Generate the used words if yet uninitialized.""" - dictionary = config.get("hints", "dictionary") + dictionary = config.val.hints.dictionary if not self.words or self.dictionary != dictionary: self.words.clear() self.dictionary = dictionary diff --git a/qutebrowser/browser/mouse.py b/qutebrowser/browser/mouse.py index d1cd889d3..619f75120 100644 --- a/qutebrowser/browser/mouse.py +++ b/qutebrowser/browser/mouse.py @@ -85,7 +85,7 @@ class MouseEventFilter(QObject): def _handle_mouse_press(self, e): """Handle pressing of a mouse button.""" - is_rocker_gesture = (config.get('input', 'rocker-gestures') and + is_rocker_gesture = (config.val.input.rocker_gestures and e.buttons() == Qt.LeftButton | Qt.RightButton) if e.button() in [Qt.XButton1, Qt.XButton2] or is_rocker_gesture: @@ -119,7 +119,7 @@ class MouseEventFilter(QObject): return True if e.modifiers() & Qt.ControlModifier: - divider = config.get('input', 'mouse-zoom-divider') + divider = config.val.zoom.mouse_divider if divider == 0: return False factor = self._tab.zoom.factor() + (e.angleDelta().y() / divider) @@ -139,7 +139,7 @@ class MouseEventFilter(QObject): def _handle_context_menu(self, _e): """Suppress context menus if rocker gestures are turned on.""" - return config.get('input', 'rocker-gestures') + return config.val.input.rocker_gestures def _mousepress_insertmode_cb(self, elem): """Check if the clicked element is editable.""" @@ -157,7 +157,7 @@ class MouseEventFilter(QObject): 'click', only_if_normal=True) else: log.mouse.debug("Clicked non-editable element!") - if config.get('input', 'auto-leave-insert-mode'): + if config.val.input.insert_mode.auto_leave: modeman.leave(self._tab.win_id, usertypes.KeyMode.insert, 'click', maybe=True) @@ -179,7 +179,7 @@ class MouseEventFilter(QObject): 'click-delayed', only_if_normal=True) else: log.mouse.debug("Clicked non-editable element (delayed)!") - if config.get('input', 'auto-leave-insert-mode'): + if config.val.input.insert_mode.auto_leave: modeman.leave(self._tab.win_id, usertypes.KeyMode.insert, 'click-delayed', maybe=True) diff --git a/qutebrowser/browser/navigate.py b/qutebrowser/browser/navigate.py index 4443c6a47..dcb578072 100644 --- a/qutebrowser/browser/navigate.py +++ b/qutebrowser/browser/navigate.py @@ -42,7 +42,7 @@ def incdec(url, count, inc_or_dec): background: Open the link in a new background tab. window: Open the link in a new window. """ - segments = set(config.get('general', 'url-incdec-segments')) + segments = set(config.val.url.incdec_segments) try: new_url = urlutils.incdec_number(url, inc_or_dec, count, segments=segments) @@ -80,10 +80,13 @@ def _find_prevnext(prev, elems): # Then check for regular links/buttons. elems = [e for e in elems if e.tag_name() != 'link'] - option = 'prev-regexes' if prev else 'next-regexes' + option = 'prev_regexes' if prev else 'next_regexes' if not elems: return None - for regex in config.get('hints', option): + + # pylint: disable=bad-config-option + for regex in getattr(config.val.hints, option): + # pylint: enable=bad-config-option log.hints.vdebug("== Checking regex '{}'.".format(regex.pattern)) for e in elems: text = str(e) diff --git a/qutebrowser/browser/network/pac.py b/qutebrowser/browser/network/pac.py index 74a6c4296..69158fe62 100644 --- a/qutebrowser/browser/network/pac.py +++ b/qutebrowser/browser/network/pac.py @@ -247,10 +247,21 @@ class PACFetcher(QObject): self._pac_url = url self._manager = QNetworkAccessManager() self._manager.setProxy(QNetworkProxy(QNetworkProxy.NoProxy)) - self._reply = self._manager.get(QNetworkRequest(url)) - self._reply.finished.connect(self._finish) self._pac = None self._error_message = None + self._reply = None + + def __eq__(self, other): + # pylint: disable=protected-access + return self._pac_url == other._pac_url + + def __repr__(self): + return utils.get_repr(self, url=self._pac_url, constructor=True) + + def fetch(self): + """Fetch the proxy from the remote URL.""" + self._reply = self._manager.get(QNetworkRequest(self._pac_url)) + self._reply.finished.connect(self._finish) @pyqtSlot() def _finish(self): diff --git a/qutebrowser/browser/network/proxy.py b/qutebrowser/browser/network/proxy.py index 1bdbc7b0b..2821a840d 100644 --- a/qutebrowser/browser/network/proxy.py +++ b/qutebrowser/browser/network/proxy.py @@ -44,7 +44,7 @@ class ProxyFactory(QNetworkProxyFactory): Return: None if proxy is correct, otherwise an error message. """ - proxy = config.get('network', 'proxy') + proxy = config.val.content.proxy if isinstance(proxy, pac.PACFetcher): return proxy.fetch_error() else: @@ -59,7 +59,7 @@ class ProxyFactory(QNetworkProxyFactory): Return: A list of QNetworkProxy objects in order of preference. """ - proxy = config.get('network', 'proxy') + proxy = config.val.content.proxy if proxy is configtypes.SYSTEM_PROXY: proxies = QNetworkProxyFactory.systemProxyForQuery(query) elif isinstance(proxy, pac.PACFetcher): @@ -69,7 +69,7 @@ class ProxyFactory(QNetworkProxyFactory): for p in proxies: if p.type() != QNetworkProxy.NoProxy: capabilities = p.capabilities() - if config.get('network', 'proxy-dns-requests'): + if config.val.content.proxy_dns_requests: capabilities |= QNetworkProxy.HostNameLookupCapability else: capabilities &= ~QNetworkProxy.HostNameLookupCapability diff --git a/qutebrowser/browser/qtnetworkdownloads.py b/qutebrowser/browser/qtnetworkdownloads.py index 512991bbc..22ec4c02c 100644 --- a/qutebrowser/browser/qtnetworkdownloads.py +++ b/qutebrowser/browser/qtnetworkdownloads.py @@ -368,7 +368,7 @@ class DownloadManager(downloads.AbstractDownloadManager): super().__init__(parent) self._networkmanager = networkmanager.NetworkManager( win_id=win_id, tab_id=None, - private=config.get('general', 'private-browsing'), parent=self) + private=config.val.content.private_browsing, parent=self) @pyqtSlot('QUrl') def get(self, url, *, user_agent=None, **kwargs): @@ -483,7 +483,7 @@ class DownloadManager(downloads.AbstractDownloadManager): reply: The QNetworkReply to download. target: Where to save the download as downloads.DownloadTarget. auto_remove: Whether to remove the download even if - ui -> remove-finished-downloads is set to -1. + downloads.remove_finished is set to -1. Return: The created DownloadItem. diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 0f86d0980..72a9fe457 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -29,12 +29,13 @@ import os import time import urllib.parse import datetime +import textwrap import pkg_resources from PyQt5.QtCore import QUrlQuery, QUrl import qutebrowser -from qutebrowser.config import config +from qutebrowser.config import config, configdata, configexc, configdiff from qutebrowser.utils import (version, utils, jinja, log, message, docutils, objreg, usertypes, qtutils) from qutebrowser.misc import objects @@ -122,8 +123,7 @@ class add_handler: # pylint: disable=invalid-name title="Error while opening qute://url", url=url.toDisplayString(), error='{} is not available with this ' - 'backend'.format(url.toDisplayString()), - icon='') + 'backend'.format(url.toDisplayString())) return 'text/html', html @@ -225,14 +225,14 @@ def qute_history(url): return 'text/html', json.dumps(history_data(start_time, offset)) else: if ( - config.get('content', 'allow-javascript') and + config.val.content.javascript.enabled and (objects.backend == usertypes.Backend.QtWebEngine or qtutils.is_qtwebkit_ng()) ): return 'text/html', jinja.render( 'history.html', title='History', - session_interval=config.get('ui', 'history-session-interval') + gap_interval=config.val.history_gap_interval ) else: # Get current date from query parameter, if not given choose today. @@ -351,20 +351,6 @@ def qute_gpl(_url): @add_handler('help') def qute_help(url): """Handler for qute://help.""" - try: - utils.read_file('html/doc/index.html') - except OSError: - html = jinja.render( - 'error.html', - title="Error while loading documentation", - url=url.toDisplayString(), - error="This most likely means the documentation was not generated " - "properly. If you are running qutebrowser from the git " - "repository, please run scripts/asciidoc2html.py. " - "If you're running a released version this is a bug, please " - "use :report to report it.", - icon='') - return 'text/html', html urlpath = url.path() if not urlpath or urlpath == '/': urlpath = 'index.html' @@ -373,11 +359,45 @@ def qute_help(url): if not docutils.docs_up_to_date(urlpath): message.error("Your documentation is outdated! Please re-run " "scripts/asciidoc2html.py.") + path = 'html/doc/{}'.format(urlpath) if urlpath.endswith('.png'): return 'image/png', utils.read_file(path, binary=True) - else: + + try: data = utils.read_file(path) + except OSError: + # No .html around, let's see if we find the asciidoc + asciidoc_path = path.replace('.html', '.asciidoc') + if asciidoc_path.startswith('html/doc/'): + asciidoc_path = asciidoc_path.replace('html/doc/', '../doc/help/') + + try: + asciidoc = utils.read_file(asciidoc_path) + except OSError: + asciidoc = None + + if asciidoc is None: + raise + + preamble = textwrap.dedent(""" + There was an error loading the documentation! + + This most likely means the documentation was not generated + properly. If you are running qutebrowser from the git repository, + please (re)run scripts/asciidoc2html.py and reload this page. + + If you're running a released version this is a bug, please use + :report to report it. + + Falling back to the plaintext version. + + --------------------------------------------------------------- + + + """) + return 'text/plain', (preamble + asciidoc).encode('utf-8') + else: return 'text/html', data @@ -390,3 +410,47 @@ def qute_backend_warning(_url): version=pkg_resources.parse_version, title="Legacy backend warning") return 'text/html', html + + +def _qute_settings_set(url): + """Handler for qute://settings/set.""" + query = QUrlQuery(url) + option = query.queryItemValue('option', QUrl.FullyDecoded) + value = query.queryItemValue('value', QUrl.FullyDecoded) + + # https://github.com/qutebrowser/qutebrowser/issues/727 + if option == 'content.javascript.enabled' and value == 'false': + msg = ("Refusing to disable javascript via qute://settings " + "as it needs javascript support.") + message.error(msg) + return 'text/html', b'error: ' + msg.encode('utf-8') + + try: + config.instance.set_str(option, value, save_yaml=True) + return 'text/html', b'ok' + except configexc.Error as e: + message.error(str(e)) + return 'text/html', b'error: ' + str(e).encode('utf-8') + + +@add_handler('settings') +def qute_settings(url): + """Handler for qute://settings. View/change qute configuration.""" + if url.path() == '/set': + return _qute_settings_set(url) + + html = jinja.render('settings.html', title='settings', + configdata=configdata, + confget=config.instance.get_str) + return 'text/html', html + + +@add_handler('configdiff') +def qute_configdiff(_url): + """Handler for qute://configdiff.""" + try: + return 'text/html', configdiff.get_diff() + except OSError as e: + error = (b'Failed to read old config: ' + + str(e.strerror).encode('utf-8')) + return 'text/plain', error diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index d400387a9..cfa1e98da 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -21,10 +21,8 @@ import html -import jinja2 - from qutebrowser.config import config -from qutebrowser.utils import usertypes, message, log, objreg +from qutebrowser.utils import usertypes, message, log, objreg, jinja class CallSuper(Exception): @@ -35,16 +33,18 @@ class CallSuper(Exception): def custom_headers(): """Get the combined custom headers.""" headers = {} - dnt = b'1' if config.get('network', 'do-not-track') else b'0' - headers[b'DNT'] = dnt - headers[b'X-Do-Not-Track'] = dnt - config_headers = config.get('network', 'custom-headers') - if config_headers is not None: - for header, value in config_headers.items(): - headers[header.encode('ascii')] = value.encode('ascii') + dnt_config = config.val.content.headers.do_not_track + if dnt_config is not None: + dnt = b'1' if dnt_config else b'0' + headers[b'DNT'] = dnt + headers[b'X-Do-Not-Track'] = dnt - accept_language = config.get('network', 'accept-language') + conf_headers = config.val.content.headers.custom + for header, value in conf_headers.items(): + headers[header.encode('ascii')] = value.encode('ascii') + + accept_language = config.val.content.headers.accept_language if accept_language is not None: headers[b'Accept-Language'] = accept_language.encode('ascii') @@ -72,7 +72,7 @@ def authentication_required(url, authenticator, abort_on): def javascript_confirm(url, js_msg, abort_on): """Display a javascript confirm prompt.""" log.js.debug("confirm: {}".format(js_msg)) - if config.get('ui', 'modal-js-dialog'): + if config.val.content.javascript.modal_dialog: raise CallSuper msg = 'From {}:
{}'.format(html.escape(url.toDisplayString()), @@ -86,9 +86,9 @@ def javascript_confirm(url, js_msg, abort_on): def javascript_prompt(url, js_msg, default, abort_on): """Display a javascript prompt.""" log.js.debug("prompt: {}".format(js_msg)) - if config.get('ui', 'modal-js-dialog'): + if config.val.content.javascript.modal_dialog: raise CallSuper - if config.get('content', 'ignore-javascript-prompt'): + if not config.val.content.javascript.prompt: return (False, "") msg = '{} asks:
{}'.format(html.escape(url.toDisplayString()), @@ -107,10 +107,10 @@ def javascript_prompt(url, js_msg, default, abort_on): def javascript_alert(url, js_msg, abort_on): """Display a javascript alert.""" log.js.debug("alert: {}".format(js_msg)) - if config.get('ui', 'modal-js-dialog'): + if config.val.content.javascript.modal_dialog: raise CallSuper - if config.get('content', 'ignore-javascript-alert'): + if not config.val.content.javascript.alert: return msg = 'From {}:
{}'.format(html.escape(url.toDisplayString()), @@ -119,6 +119,22 @@ def javascript_alert(url, js_msg, abort_on): abort_on=abort_on) +def javascript_log_message(level, source, line, msg): + """Display a JavaScript log message.""" + logstring = "[{}:{}] {}".format(source, line, msg) + # Needs to line up with the values allowed for the + # content.javascript.log setting. + logmap = { + 'none': lambda arg: None, + 'debug': log.js.debug, + 'info': log.js.info, + 'warning': log.js.warning, + 'error': log.js.error, + } + logger = logmap[config.val.content.javascript.log[level.name]] + logger(logstring) + + def ignore_certificate_errors(url, errors, abort_on): """Display a certificate error question. @@ -129,7 +145,7 @@ def ignore_certificate_errors(url, errors, abort_on): Return: True if the error should be ignored, False otherwise. """ - ssl_strict = config.get('network', 'ssl-strict') + ssl_strict = config.val.content.ssl_strict log.webview.debug("Certificate errors {!r}, strict {}".format( errors, ssl_strict)) @@ -137,7 +153,7 @@ def ignore_certificate_errors(url, errors, abort_on): assert error.is_overridable(), repr(error) if ssl_strict == 'ask': - err_template = jinja2.Template(""" + err_template = jinja.environment.from_string(""" Errors while loading {{url.toDisplayString()}}: