diff options
author | Philipp Albrecht <philipp.albrecht@momox.biz> | 2021-11-26 15:47:05 +0100 |
---|---|---|
committer | Philipp Albrecht <palbrecht@mailbox.org> | 2021-11-28 15:50:04 +0100 |
commit | b900f1dd309cf7102d729316edb4c4aa7a5ed9de (patch) | |
tree | eed6b07ee6954d633bdc0f9f7399e6a352adaeac /qutebrowser | |
parent | a4213a4bb6245223ac2cb8bc112d3cf6ea086d24 (diff) | |
download | qutebrowser-b900f1dd309cf7102d729316edb4c4aa7a5ed9de.tar.gz qutebrowser-b900f1dd309cf7102d729316edb4c4aa7a5ed9de.zip |
Make interpreting number keys as counts configurable
By default numbers are interpreted as counts for bindings. Making this
behavior configurable allows for emacs-like bindings, where number keys
are passed through.
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/config/configdata.yml | 11 | ||||
-rw-r--r-- | qutebrowser/keyinput/basekeyparser.py | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index e034fe8f5..3c5dc6f2f 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1794,6 +1794,17 @@ input.media_keys: On Linux, disabling this also disables Chromium's MPRIS integration. +input.match_counts: + default: true + type: Bool + desc: >- + Interpret number prefixes as counts for bindings. + + This enables for vi-like bindings that can be prefixed with a number to + indicate a count. + Disabling it allows for emacs-like bindings where number keys are passed + through (according to `input.forward_unbound_keys`) instead. + ## keyhint keyhint.blacklist: diff --git a/qutebrowser/keyinput/basekeyparser.py b/qutebrowser/keyinput/basekeyparser.py index 7e688dab1..4db1d5d76 100644 --- a/qutebrowser/keyinput/basekeyparser.py +++ b/qutebrowser/keyinput/basekeyparser.py @@ -254,6 +254,9 @@ class BaseKeyParser(QObject): def _match_count(self, sequence: keyutils.KeySequence, dry_run: bool) -> bool: """Try to match a key as count.""" + if not config.val.input.match_counts: + return False + txt = str(sequence[-1]) # To account for sequences changed above. if (txt in string.digits and self._supports_count and not (not self._count and txt == '0')): |