Skip to main content

VimMode

Enum VimMode 

Source
#[repr(u16)]
pub enum VimMode {
Show 14 variants Normal = 0, Insert = 1, Visual = 2, VisualLine = 3, VisualBlock = 4, Replace = 5, CommandLine = 6, Window = 8, Delete = 9, Yank = 10, Change = 11, Lowercase = 12, Uppercase = 13, ToggleCase = 14,
}
Expand description

Vim editing modes.

Each variant represents a distinct Vim mode with specific behavior:

  • Cursor style (block, bar, underline)
  • Whether it accepts character input
  • Whether it has an active selection
  • Parent mode for keybinding inheritance

Variants§

§

Normal = 0

Normal mode - default command mode.

§

Insert = 1

Insert mode - text input mode.

§

Visual = 2

Visual character mode - character-wise selection.

§

VisualLine = 3

Visual line mode - line-wise selection.

§

VisualBlock = 4

Visual block mode - block/column selection.

§

Replace = 5

Replace mode - overwrite text.

§

CommandLine = 6

Command line mode - ex commands.

§

Window = 8

Window mode - window management (<C-w> prefix).

§

Delete = 9

Delete operator mode - waiting for motion to delete.

§

Yank = 10

Yank operator mode - waiting for motion to yank.

§

Change = 11

Change operator mode - waiting for motion to change.

§

Lowercase = 12

Lowercase operator mode - waiting for motion to lowercase.

§

Uppercase = 13

Uppercase operator mode - waiting for motion to uppercase.

§

ToggleCase = 14

Toggle case operator mode - waiting for motion to toggle case.

Implementations§

Source§

impl VimMode

Source

pub const ALL: &'static [Self]

All Vim modes for registration.

Source

pub const NORMAL_ID: ModeId

Mode ID for Normal mode.

Source

pub const INSERT_ID: ModeId

Mode ID for Insert mode.

Source

pub const VISUAL_ID: ModeId

Mode ID for Visual mode (character-wise).

Source

pub const VISUAL_LINE_ID: ModeId

Mode ID for Visual Line mode.

Source

pub const VISUAL_BLOCK_ID: ModeId

Mode ID for Visual Block mode.

Source

pub const REPLACE_ID: ModeId

Mode ID for Replace mode.

Source

pub const COMMANDLINE_ID: ModeId

Mode ID for Command-line mode.

Source

pub const WINDOW_ID: ModeId

Mode ID for Window mode.

Source

pub const DELETE_ID: ModeId

Mode ID for Delete mode.

Source

pub const YANK_ID: ModeId

Mode ID for Yank mode.

Source

pub const CHANGE_ID: ModeId

Mode ID for Change mode.

Source

pub const LOWERCASE_ID: ModeId

Mode ID for Lowercase operator mode.

Source

pub const UPPERCASE_ID: ModeId

Mode ID for Uppercase operator mode.

Source

pub const TOGGLE_CASE_ID: ModeId

Mode ID for Toggle Case operator mode.

Trait Implementations§

Source§

impl Clone for VimMode

Source§

fn clone(&self) -> VimMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VimMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for VimMode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mode for VimMode

Source§

fn module() -> ModuleId

The module that owns this mode type. Read more
Source§

fn discriminant(&self) -> u16

Get the unique discriminant for this mode variant. Read more
Source§

fn id(&self) -> ModeId

Convert to the runtime storage type. Read more
Source§

fn display_name(&self) -> &'static str

Get the display name for this mode. Read more
Source§

fn cursor_style(&self) -> CursorStyle

Get the cursor style for this mode. Read more
Source§

fn accepts_char_input(&self) -> bool

Whether this mode accepts direct character input. Read more
Source§

fn has_selection(&self) -> bool

Whether this mode has an active selection. Read more
Source§

fn inherits_from(&self) -> Option<Self>

Get the parent mode for keybinding inheritance. Read more
Source§

fn is_entry(&self) -> bool

Whether this is the entry/default mode for new sessions. Read more
Source§

impl PartialEq for VimMode

Source§

fn eq(&self, other: &VimMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for VimMode

Source§

impl Eq for VimMode

Source§

impl StructuralPartialEq for VimMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more