pub struct KeybindingRegistration {
pub keys: &'static str,
pub command_id: CommandId,
pub modes: &'static [&'static str],
pub description: &'static str,
pub category: Option<&'static str>,
pub enabled: bool,
pub priority: u32,
pub depends_on: &'static [&'static str],
pub flags: RegistrationFlags,
}Expand description
Keybinding registration descriptor.
Linux equivalent: Like struct input_device_id - declares key matching.
Fields§
§keys: &'static strKey sequence in vim notation (e.g., "dd", "<C-w>h", "<Space>ff").
command_id: CommandIdCommand ID to invoke (compile-time verified).
modes: &'static [&'static str]Modes where binding is active (e.g., &["normal"], &["normal", "visual"]).
Empty slice means all modes (like Linux’s match-all).
description: &'static strDescription for which-key / help.
category: Option<&'static str>Category for which-key grouping (e.g., “window”, “file”, “search”).
enabled: boolWhether binding is enabled (for conditional keybindings).
priority: u32Priority for conflict resolution (lower = higher priority). Like Linux driver priority for matching.
depends_on: &'static [&'static str]Dependencies on other keybindings or commands.
flags: RegistrationFlagsRegistration flags.
Implementations§
Source§impl KeybindingRegistration
impl KeybindingRegistration
Sourcepub const fn new(keys: &'static str, command_id: CommandId) -> Self
pub const fn new(keys: &'static str, command_id: CommandId) -> Self
Create a new keybinding registration.
The command_id parameter is a typed CommandId, enabling compile-time
verification that the referenced command exists. Import command ID constants
from the appropriate module (e.g., reovim_module_editor::ids::CURSOR_DOWN).
Sourcepub const fn with_modes(self, modes: &'static [&'static str]) -> Self
pub const fn with_modes(self, modes: &'static [&'static str]) -> Self
Set active modes.
Sourcepub const fn with_description(self, desc: &'static str) -> Self
pub const fn with_description(self, desc: &'static str) -> Self
Set description.
Sourcepub const fn with_category(self, cat: &'static str) -> Self
pub const fn with_category(self, cat: &'static str) -> Self
Set category.
Sourcepub const fn with_disabled(self) -> Self
pub const fn with_disabled(self) -> Self
Disable the keybinding.
Sourcepub const fn with_priority(self, priority: u32) -> Self
pub const fn with_priority(self, priority: u32) -> Self
Set priority.
Sourcepub const fn with_depends_on(self, deps: &'static [&'static str]) -> Self
pub const fn with_depends_on(self, deps: &'static [&'static str]) -> Self
Set dependencies.
Sourcepub const fn with_flags(self, flags: RegistrationFlags) -> Self
pub const fn with_flags(self, flags: RegistrationFlags) -> Self
Set registration flags.
Trait Implementations§
Source§impl Clone for KeybindingRegistration
impl Clone for KeybindingRegistration
Source§fn clone(&self) -> KeybindingRegistration
fn clone(&self) -> KeybindingRegistration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more