Skip to content

feat(config): support ordered key-binding behaviors #44

Closed

Description

@benbenbang

Parent

Part of #43.

Summary

Extend [key-bindings] so each OS can define a chord and an ordered behavior chain.

[key-bindings]
macos = { key = "ctrl-o", behaviors = ["zoxide", "cj"] }
linux = { key = "alt-o", behaviors = ["cj", "zoxide"] }
windows = { key = "ctrl-o", behaviors = ["cj"] }

An empty behaviors array disables the binding. Preserve the existing string form as a shorthand for the default behavior chain where practical.

Semantics

  • evaluate behaviors from left to right
  • zoxide and cj are the initial allowed values
  • unavailable dependencies or an empty candidate source advance to the next behavior
  • user cancellation stops evaluation without modifying the buffer or directory
  • an actual execution error stops evaluation and produces a durable shell-visible diagnostic
  • do not add an implicit dependency-based auto mode
  • reject unknown, duplicate, or invalid behavior entries with actionable configuration errors

Acceptance criteria

  • parsing, validation, defaults, serialization, and sample configuration cover the new structure
  • the selected OS binding is deterministic
  • an empty chain renders no key binding
  • generated shell integration receives the ordered configuration without re-reading TOML on every keypress
  • tests cover both behavior orders, single-behavior configurations, disabled bindings, shorthand migration, and invalid values

Delivery

Implemented in #53 and released in 0.4.0 as part of #43.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions