Skip to main content

MotionKind

Enum MotionKind 

Source
pub enum MotionKind {
Show 92 variants Left, LeftWrap, Right, RightWrap, Up, Down, LineStart, FirstNonBlank, LineEnd, LastNonBlank, ScreenLineStart, ScreenFirstNonBlank, ScreenLineEnd, ScreenLastNonBlank, ScreenMiddle, LineMiddle, Column, ByteOffset, WordForward, BigWordForward, WordEndForward, BigWordEndForward, WordBackward, BigWordBackward, WordEndBackward, BigWordEndBackward, FindForward, FindBackward, TillForward, TillBackward, RepeatCharacterSearch, ReverseCharacterSearch, PreviousLineFirstNonBlank, NextLineFirstNonBlank, CountedLineFirstNonBlank, BufferTop, BufferBottom, BufferBottomEnd, BufferPercentage, WindowTop, WindowMiddle, WindowBottom, SentenceBackward, SentenceForward, ParagraphBackward, ParagraphForward, SectionStartBackward, SectionStartForward, SectionEndBackward, SectionEndForward, MatchingPair, MatchingPairBackward, UnmatchedOpenBackward, UnmatchedCloseForward, MethodBackward, MethodForward, PreprocessorBackward, PreprocessorForward, CommentBackward, CommentForward, DiffChangeBackward, DiffChangeForward, SearchNext, SearchPrevious, SearchWordForward, SearchWordBackward, SearchPartialWordForward, SearchPartialWordBackward, PreviousMarkLine, PreviousMarkExact, NextMarkLine, NextMarkExact, HalfPageDown, HalfPageUp, PageDown, PageUp, ScrollLineDown, ScrollLineUp, CursorToWindowTop, CursorToWindowTopFirstNonBlank, CursorToWindowMiddle, CursorToWindowMiddleFirstNonBlank, CursorToWindowBottom, CursorToWindowBottomFirstNonBlank, NextWindowTop, PreviousWindowBottom, ScrollColumnLeft, ScrollColumnRight, ScrollHalfScreenLeft, ScrollHalfScreenRight, CursorToWindowLeft, CursorToWindowRight,
}
Expand description

Vim’s standalone cursor and viewport movement vocabulary.

Most variants are handled entirely by apply. Search and mark variants are vocabulary signals for adapters because their resources intentionally remain outside this crate; direct apply calls leave the cursor unchanged for those variants. crate::MotionState resolves the two character-search repetition variants to a concrete find/till motion before application.

Variants§

§

Left

h or Left.

§

LeftWrap

Backspace or Ctrl-H when 'whichwrap' permits crossing lines.

§

Right

l or Right.

§

RightWrap

Space when 'whichwrap' permits crossing lines.

§

Up

k, Up, or Ctrl-P.

§

Down

j, Down, Ctrl-J, Ctrl-N, or newline.

§

LineStart

0 or Home.

§

FirstNonBlank

^.

§

LineEnd

$ or End.

§

LastNonBlank

g_.

§

ScreenLineStart

g0.

§

ScreenFirstNonBlank

g^.

§

ScreenLineEnd

g$.

§

ScreenLastNonBlank

g<End>.

§

ScreenMiddle

gm.

§

LineMiddle

gM.

§

Column

|.

§

ByteOffset

go.

§

WordForward

w.

§

BigWordForward

W.

§

WordEndForward

e.

§

BigWordEndForward

E.

§

WordBackward

b.

§

BigWordBackward

B.

§

WordEndBackward

ge.

§

BigWordEndBackward

gE.

§

FindForward

f{char}.

§

FindBackward

F{char}.

§

TillForward

t{char}.

§

TillBackward

T{char}.

§

RepeatCharacterSearch

;, resolved by crate::MotionState.

§

ReverseCharacterSearch

,, resolved by crate::MotionState.

§

PreviousLineFirstNonBlank

-.

§

NextLineFirstNonBlank

+ or Enter.

§

CountedLineFirstNonBlank

_.

§

BufferTop

gg or Ctrl-Home.

§

BufferBottom

G.

§

BufferBottomEnd

Ctrl-End.

§

BufferPercentage

{count}%.

§

WindowTop

H.

§

WindowMiddle

M.

§

WindowBottom

L.

§

SentenceBackward

(.

§

SentenceForward

).

§

ParagraphBackward

{.

§

ParagraphForward

}.

§

SectionStartBackward

[[.

§

SectionStartForward

]].

§

SectionEndBackward

[].

§

SectionEndForward

][.

§

MatchingPair

% without a count.

§

MatchingPairBackward

g%.

§

UnmatchedOpenBackward

[( or [{; the delimiter is stored in Motion::target.

§

UnmatchedCloseForward

]) or ]}; the delimiter is stored in Motion::target.

§

MethodBackward

[m or [M.

§

MethodForward

]m or ]M.

§

PreprocessorBackward

[#.

§

PreprocessorForward

]#.

§

CommentBackward

[* or [/.

§

CommentForward

]* or ]/.

§

DiffChangeBackward

[c in diff text.

§

DiffChangeForward

]c in diff text.

§

SearchNext

n, applied by the caller’s retained search state.

§

SearchPrevious

N, applied by the caller’s retained search state.

§

SearchWordForward

*, applied by the caller’s retained search state.

§

SearchWordBackward

#, applied by the caller’s retained search state.

§

SearchPartialWordForward

g*, applied by the caller’s retained search state.

§

SearchPartialWordBackward

g#, applied by the caller’s retained search state.

§

PreviousMarkLine

[', applied by the caller’s resource-aware mark store.

§

PreviousMarkExact

[`, applied by the caller’s resource-aware mark store.

§

NextMarkLine

]', applied by the caller’s resource-aware mark store.

§

NextMarkExact

]`, applied by the caller’s resource-aware mark store.

§

HalfPageDown

Ctrl-D.

§

HalfPageUp

Ctrl-U.

§

PageDown

Ctrl-F or PageDown.

§

PageUp

Ctrl-B or PageUp.

§

ScrollLineDown

Ctrl-E.

§

ScrollLineUp

Ctrl-Y.

§

CursorToWindowTop

zt.

§

CursorToWindowTopFirstNonBlank

z<CR>.

§

CursorToWindowMiddle

zz.

§

CursorToWindowMiddleFirstNonBlank

z..

§

CursorToWindowBottom

zb.

§

CursorToWindowBottomFirstNonBlank

z-.

§

NextWindowTop

z+.

§

PreviousWindowBottom

z^.

§

ScrollColumnLeft

zh.

§

ScrollColumnRight

zl.

§

ScrollHalfScreenLeft

zH.

§

ScrollHalfScreenRight

zL.

§

CursorToWindowLeft

zs.

§

CursorToWindowRight

ze.

Trait Implementations§

Source§

impl Clone for MotionKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for MotionKind

Source§

impl Debug for MotionKind

Source§

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

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

impl Eq for MotionKind

Source§

impl Hash for MotionKind

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 PartialEq for MotionKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MotionKind

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.