pub enum Operator {
Show 14 variants
Delete,
Change,
Yank,
Uppercase,
Lowercase,
ToggleCase,
Indent,
Outdent,
Fold,
Reflow,
ReflowKeepCursor,
AutoIndent,
Filter,
Comment,
}Variants§
Delete
Change
Yank
Uppercase
gU{motion} — uppercase the range. Entered via the g prefix
in normal mode or U in visual mode.
Lowercase
gu{motion} — lowercase the range. u in visual mode.
ToggleCase
g~{motion} — toggle case of the range. ~ in visual mode
(character at the cursor for the single-char ~ command stays
its own code path in normal mode).
Indent
>{motion} — indent the line range by shiftwidth spaces.
Always linewise, even when the motion is char-wise — mirrors
vim’s behaviour where >w indents the current line, not the
word on it.
Outdent
<{motion} — outdent the line range (remove up to
shiftwidth leading spaces per line).
Fold
zf{motion} / zf{textobj} / Visual zf — create a closed
fold spanning the row range. Doesn’t mutate the buffer text;
cursor restores to the operator’s start position.
Reflow
gq{motion} — reflow the row range to settings.textwidth.
Greedy word-wrap: collapses each paragraph (blank-line-bounded
run) into space-separated words, then re-emits lines whose
width stays under textwidth. Always linewise, like indent.
ReflowKeepCursor
gw{motion} — same reflow as gq but cursor stays at the
pre-reflow (row, col). If the reflow shrinks the line so the
original col is past the new EOL, the col is clamped to the last
char of the line (vim’s behaviour). Always linewise.
AutoIndent
={motion} — auto-indent the line range using shiftwidth-based
bracket depth counting (v1 dumb reindent). Always linewise.
See auto_indent_range for the algorithm and its limitations.
Filter
!{motion} — filter the line range through an external shell command.
The range text is piped to the command’s stdin; stdout replaces the
range in the buffer. Non-zero exit or spawn failure returns an error
to the caller without mutating the buffer.
Comment
gc{motion} / gcc — toggle line comments on the row range.
Dispatched through Editor::toggle_comment_range rather than the
normal run_operator_over_range pipeline (same pattern as Filter).