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§
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