Update docs
This commit is contained in:
parent
927c2ff94a
commit
6168622de3
@ -25,6 +25,8 @@ Added
|
|||||||
opened from a page should stack on each other or not.
|
opened from a page should stack on each other or not.
|
||||||
- New `completion.open_categories` setting which allows to configure which
|
- New `completion.open_categories` setting which allows to configure which
|
||||||
categories are shown in the `:open` completion, and how they are ordered.
|
categories are shown in the `:open` completion, and how they are ordered.
|
||||||
|
- New `:config-add-dict` and `:config-add-list` commands to easily add a new
|
||||||
|
element to a dict/list setting.
|
||||||
|
|
||||||
Changed
|
Changed
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
@ -36,6 +36,8 @@ It is possible to run or bind multiple commands by separating them with `;;`.
|
|||||||
|<<clear-messages,clear-messages>>|Clear all message notifications.
|
|<<clear-messages,clear-messages>>|Clear all message notifications.
|
||||||
|<<click-element,click-element>>|Click the element matching the given filter.
|
|<<click-element,click-element>>|Click the element matching the given filter.
|
||||||
|<<close,close>>|Close the current window.
|
|<<close,close>>|Close the current window.
|
||||||
|
|<<config-add-dict,config-add-dict>>|Add a key/value pair to a dictionary option.
|
||||||
|
|<<config-add-list,config-add-list>>|Append a value to a config option that is a list.
|
||||||
|<<config-clear,config-clear>>|Set all settings back to their default.
|
|<<config-clear,config-clear>>|Set all settings back to their default.
|
||||||
|<<config-cycle,config-cycle>>|Cycle an option between multiple values.
|
|<<config-cycle,config-cycle>>|Cycle an option between multiple values.
|
||||||
|<<config-edit,config-edit>>|Open the config.py file in the editor.
|
|<<config-edit,config-edit>>|Open the config.py file in the editor.
|
||||||
@ -266,6 +268,35 @@ The given filter needs to result in exactly one element, otherwise, an error is
|
|||||||
=== close
|
=== close
|
||||||
Close the current window.
|
Close the current window.
|
||||||
|
|
||||||
|
[[config-add-dict]]
|
||||||
|
=== config-add-dict
|
||||||
|
Syntax: +:config-add-dict [*--temp*] [*--replace*] 'option' 'key' 'value'+
|
||||||
|
|
||||||
|
Add a key/value pair to a dictionary option.
|
||||||
|
|
||||||
|
==== positional arguments
|
||||||
|
* +'option'+: The name of the option.
|
||||||
|
* +'key'+: The key to use.
|
||||||
|
* +'value'+: The value to place in the dictionary.
|
||||||
|
|
||||||
|
==== optional arguments
|
||||||
|
* +*-t*+, +*--temp*+: Set value temporarily until qutebrowser is closed.
|
||||||
|
* +*-r*+, +*--replace*+: Replace existing values. By default, existing values are not overwritten.
|
||||||
|
|
||||||
|
|
||||||
|
[[config-add-list]]
|
||||||
|
=== config-add-list
|
||||||
|
Syntax: +:config-add-list [*--temp*] 'option' 'value'+
|
||||||
|
|
||||||
|
Append a value to a config option that is a list.
|
||||||
|
|
||||||
|
==== positional arguments
|
||||||
|
* +'option'+: The name of the option.
|
||||||
|
* +'value'+: The value to append to the end of the list.
|
||||||
|
|
||||||
|
==== optional arguments
|
||||||
|
* +*-t*+, +*--temp*+: Set value temporarily until qutebrowser is closed.
|
||||||
|
|
||||||
[[config-clear]]
|
[[config-clear]]
|
||||||
=== config-clear
|
=== config-clear
|
||||||
Syntax: +:config-clear [*--save*]+
|
Syntax: +:config-clear [*--save*]+
|
||||||
@ -326,7 +357,7 @@ This sets an option back to its default and removes it from autoconfig.yml.
|
|||||||
* +'option'+: The name of the option.
|
* +'option'+: The name of the option.
|
||||||
|
|
||||||
==== optional arguments
|
==== optional arguments
|
||||||
* +*-t*+, +*--temp*+: Don't touch autoconfig.yml.
|
* +*-t*+, +*--temp*+: Set value temporarily until qutebrowser is closed.
|
||||||
|
|
||||||
[[config-write-py]]
|
[[config-write-py]]
|
||||||
=== config-write-py
|
=== config-write-py
|
||||||
|
@ -55,13 +55,13 @@ def dict_option(*, info):
|
|||||||
|
|
||||||
|
|
||||||
def _option(info, title, predicate):
|
def _option(info, title, predicate):
|
||||||
"""A CompletionModel that is generified for several option sets.
|
"""A CompletionModel that is generated for several option sets.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
info: The config info that can be passed through.
|
info: The config info that can be passed through.
|
||||||
title: The title of the options.
|
title: The title of the options.
|
||||||
predicate: The function for filtering out the options. Takes a single
|
predicate: The function for filtering out the options. Takes a single
|
||||||
argument.
|
argument.
|
||||||
"""
|
"""
|
||||||
model = completionmodel.CompletionModel(column_widths=(20, 70, 10))
|
model = completionmodel.CompletionModel(column_widths=(20, 70, 10))
|
||||||
options = ((opt.name, opt.description, info.config.get_str(opt.name))
|
options = ((opt.name, opt.description, info.config.get_str(opt.name))
|
||||||
|
@ -274,17 +274,15 @@ class ConfigCommands:
|
|||||||
@cmdutils.register(instance='config-commands')
|
@cmdutils.register(instance='config-commands')
|
||||||
@cmdutils.argument('option', completion=configmodel.dict_option)
|
@cmdutils.argument('option', completion=configmodel.dict_option)
|
||||||
def config_add_dict(self, option, key, value, temp=False, replace=False):
|
def config_add_dict(self, option, key, value, temp=False, replace=False):
|
||||||
"""Add a value at the key within the option specified.
|
"""Add a key/value pair to a dictionary option.
|
||||||
|
|
||||||
This adds an element to a dictionary. --replace is needed to override
|
|
||||||
existing values.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
option: The name of the option.
|
option: The name of the option.
|
||||||
key: The key to use.
|
key: The key to use.
|
||||||
value: The value to place in the dictionary.
|
value: The value to place in the dictionary.
|
||||||
temp: Set value temporarily until qutebrowser is closed.
|
temp: Set value temporarily until qutebrowser is closed.
|
||||||
replace: Whether or not we should replace, default is not.
|
replace: Replace existing values. By default, existing values are
|
||||||
|
not overwritten.
|
||||||
"""
|
"""
|
||||||
opt = self._config.get_opt(option)
|
opt = self._config.get_opt(option)
|
||||||
if not isinstance(opt.typ, configtypes.Dict):
|
if not isinstance(opt.typ, configtypes.Dict):
|
||||||
|
Loading…
Reference in New Issue
Block a user