pub struct WhichKeyTrigger {
pub prefix: KeySequence,
}Expand description
Command to trigger which-key with a specific prefix
This is used as an inline command for keybindings like g?, z?, etc.
Each binding carries its own prefix so which-key knows what to filter.
Fields§
§prefix: KeySequenceImplementations§
Source§impl WhichKeyTrigger
impl WhichKeyTrigger
pub const fn new(prefix: KeySequence) -> Self
pub fn all() -> Self
Sourcepub fn arc(prefix: KeySequence) -> Arc<dyn CommandTrait>
pub fn arc(prefix: KeySequence) -> Arc<dyn CommandTrait>
Create an Arc-wrapped command for use as inline command
Trait Implementations§
Source§impl Clone for WhichKeyTrigger
impl Clone for WhichKeyTrigger
Source§fn clone(&self) -> WhichKeyTrigger
fn clone(&self) -> WhichKeyTrigger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CommandTrait for WhichKeyTrigger
impl CommandTrait for WhichKeyTrigger
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Unique identifier for this command (e.g.,
cursor_up, enter_insert_mode)Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Human-readable description for help/documentation
Source§fn execute(&self, _ctx: &mut ExecutionContext<'_>) -> CommandResult
fn execute(&self, _ctx: &mut ExecutionContext<'_>) -> CommandResult
Execute the command on the given buffer Read more
Source§fn valid_modes(&self) -> Option<Vec<ModeState>>
fn valid_modes(&self) -> Option<Vec<ModeState>>
Optional: which modes this command is valid in (None = all modes)
Source§fn supports_count(&self) -> bool
fn supports_count(&self) -> bool
Optional: does this command support repeat count?
Source§fn is_jump(&self) -> bool
fn is_jump(&self) -> bool
Whether this command is a “jump” that should be recorded in the jump list Read more
Source§fn is_text_modifying(&self) -> bool
fn is_text_modifying(&self) -> bool
Whether this command modifies buffer text content Read more
Auto Trait Implementations§
impl Freeze for WhichKeyTrigger
impl RefUnwindSafe for WhichKeyTrigger
impl Send for WhichKeyTrigger
impl Sync for WhichKeyTrigger
impl Unpin for WhichKeyTrigger
impl UnwindSafe for WhichKeyTrigger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more