bind: show all modes by default

Ensure `bind` builtin lists binds for all modes if `--mode` is not
given.

- The `get` function in `src/input.rs` now takes an optional bind
  mode and returns a list of input mappings (binds).
- The `list_one` function in `src/builtins/bind.rs` lists binds in
  the results returned by `get`.
- Creating the output string for a bind has been extracted to its
  own function: `BuiltinBind::generate_output_string`.
- The `bind_mode_given` option has been removed.

Fixes #12214

Closes #12285
This commit is contained in:
iksuddle
2026-01-05 16:22:08 -05:00
committed by Johannes Altmanninger
parent bbb2f0de8d
commit 8e34dc4cdb
5 changed files with 100 additions and 83 deletions

View File

@@ -19,8 +19,8 @@ Description
``bind`` manages key bindings.
If both ``KEYS`` and ``COMMAND`` are given, ``bind`` adds (or replaces) a binding in ``MODE``.
If only ``KEYS`` is given, any existing binding for those keys in the given ``MODE`` will be printed.
If no ``KEYS`` argument is provided, all bindings (in the given ``MODE``) are printed.
If only ``KEYS`` is given, ``bind`` lists any existing bindings for those keys in ``MODE`` or in all modes.
If no ``KEYS`` argument is provided, ``bind`` lists all bindings in ``MODE`` or in all modes.
``KEYS`` is a comma-separated list of key names.
Modifier keys can be specified by prefixing a key name with a combination of ``ctrl-``, ``alt-``, ``shift-`` and ``super-`` (i.e. the "windows" or "command" key).