pub enum Motion {
Show 27 variants
Left,
Right,
Up,
Down,
WordStartNext,
WordEndNext,
WordStartPrev,
LineStart,
LineFirstNonBlank,
LineEnd,
DocStart,
DocEnd,
PageUp,
PageDown,
HalfPageUp,
HalfPageDown,
GotoLine(u32),
ForwardSexp,
BackwardSexp,
UpList,
DownList,
BeginningOfDefun,
EndOfDefun,
BeginningOfSexp,
EndOfSexp,
SearchNext,
SearchPrev,
}Expand description
Cursor motions — primitive movements the keymap compiles user keys to.
Two families:
- Text motions — vim-ish char/word/line/doc/page motions.
- Structural motions — Lisp-aware
(forward-sexp)/(backward-sexp)/(up-list)/(down-list)equivalents. Enabled on buffers whose major mode opts in via(defmajor-mode … :structural-lisp #t). Matches paredit’s model — equal-or-superior to emacs on Lisp UX.
Variants§
Left
Right
Up
Down
WordStartNext
WordEndNext
WordStartPrev
LineStart
LineFirstNonBlank
LineEnd
DocStart
DocEnd
PageUp
PageDown
HalfPageUp
HalfPageDown
GotoLine(u32)
ForwardSexp
Move to the start of the next sibling s-expression.
BackwardSexp
Move to the start of the previous sibling s-expression.
UpList
Move up one parenthesis level — to the opening ( of the enclosing list.
DownList
Move down into the current list — past the opening (.
BeginningOfDefun
Move to the start of the enclosing top-level defun / top form.
EndOfDefun
Move to the end of the enclosing top-level defun / top form.
BeginningOfSexp
Move to the start of the current s-expression (current atom / list open).
EndOfSexp
Move to the end of the current s-expression (matching close).
SearchNext
To the next search match — vim’s n used as a MOTION, which is what
makes d/foo<CR>, dn and y* work. Search being a motion rather
than a bare cursor jump is the difference between a search box and vim
search; resolving it needs the committed SearchState, so the executor
supplies it — the enum stays a pure description, like every other arm.
SearchPrev
To the previous search match (vim’s N as a motion).
Implementations§
Source§impl Motion
impl Motion
Sourcepub const fn is_inclusive(self) -> bool
pub const fn is_inclusive(self) -> bool
Does this motion name a character to ACT ON, rather than a boundary to stop before?
vim’s exclusive/inclusive split, and it is not cosmetic: dw deletes
up to the next word and de deletes through the current one. An
operator range is [cursor, target), so an inclusive motion’s target
has to be widened by one character or the operator leaves the last
character behind — off by exactly one, on the key most likely to be
used to delete a word without its trailing space.
WordEndNext is the only inclusive motion escriba has today. f/t/
% are the others in vim and are not bound yet; each lands here when
it does, which is the point of asking the MOTION rather than
special-casing e at the operator.
pub const fn is_structural(self) -> bool
Trait Implementations§
impl Copy for Motion
Source§impl<'de> Deserialize<'de> for Motion
impl<'de> Deserialize<'de> for Motion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Motion
Source§impl JsonSchema for Motion
impl JsonSchema for Motion
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more