Documentation
¶
Overview ¶
Package keymap maps the normal-mode action keys (inspect, logs, filter, …) to the keys that trigger them, loaded from the same d9c-config.yaml file the theme uses. It ships sensible defaults and lets the user remap any action via a "keys:" section without touching navigation (j/k/arrows), Enter or the exit keys (q/esc/Ctrl+C), which stay fixed so the app can never lock itself out.
Example d9c-config.yaml:
keys: # optional; only the actions you want to change logs: g # show logs with "g" instead of "l" filter: f # filter with "f" instead of "/"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action string
Action identifies a remappable normal-mode action. The string value is also the key used under "keys:" in the config file.
const ( Inspect Action = "inspect" Logs Action = "logs" Edit Action = "edit" Exec Action = "exec" Filter Action = "filter" Command Action = "command" ToggleAll Action = "toggle-all" Stats Action = "stats" Select Action = "select" Copy Action = "copy" Refresh Action = "refresh" Pause Action = "pause" Help Action = "help" )
The remappable normal-mode actions. Navigation, Enter and the exit keys are intentionally not actions: they stay fixed.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map binds actions to keys (and the reverse, for key dispatch). The zero value is unusable; build one with Default or Resolve.
func Load ¶
Load reads the config file at path and resolves its "keys:" overrides on top of the defaults. A missing file yields the defaults (not an error); malformed YAML, an unknown action, an empty/reserved key, or a key bound to two actions is an error.
func Resolve ¶
Resolve applies the given action→key overrides on top of the defaults, validating action names, keys and conflicts. A nil/empty map yields the defaults unchanged.