zudo-codemirror

Type to search...

to open search from anywhere

Commands & Motions

CreatedMar 29, 2026UpdatedMar 29, 2026Takeshi Takatsudo

Reference for supported vim commands, motions, operators, and text objects in @replit/codemirror-vim.

Commands & Motions

This page lists the vim commands and motions supported by @replit/codemirror-vim. The coverage closely matches core vim behavior, though some less common features may be absent.

Motion Commands

Motions move the cursor without modifying text. They can also be used after an operator to define the range of text to act on.

Character and Word Motions

KeyMotion
hleft
jdown
kup
lright
wstart of next word
bstart of previous word
eend of current/next word
Wstart of next WORD (whitespace-delimited)
Bstart of previous WORD
Eend of current/next WORD

Line Motions

KeyMotion
0first column of the line
^first non-blank character of the line
$end of the line
ggfirst line of the document
Glast line of the document (or line N with count)

Find Motions

KeyMotion
f{char}next occurrence of {char} on the line
F{char}previous occurrence of {char} on the line
t{char}just before the next occurrence of {char} on the line
T{char}just after the previous occurrence of {char} on the line
;repeat last f/F/t/T motion
,repeat last f/F/t/T in reverse

Other Motions

KeyMotion
%matching bracket/parenthesis/brace
{previous blank line (paragraph boundary)
}next blank line (paragraph boundary)

Operator Commands

Operators act on a range defined by a subsequent motion or text object.

KeyOperator
ddelete
cchange (delete and enter insert mode)
yyank (copy)
>indent right
<indent left
=auto-indent
gqformat/wrap text

Operator + Motion Combinations

Combine an operator with a motion to act on the text between the cursor and the motion target.

dw      delete from cursor to start of next word
d$      delete from cursor to end of line
d0      delete from cursor to start of line
cw      change word
cb      change back one word
yy      yank entire line (operator doubled = act on line)
dd      delete entire line
>>      indent current line
<<      unindent current line
gqq     format current line

Operator + Text Object Combinations

Text objects define a structured region of text. Combine them with operators for precise editing.

diw     delete inner word
daw     delete a word (including surrounding space)
ci"     change inside double quotes
ca"     change around double quotes (including the quotes)
di(     delete inside parentheses
da(     delete around parentheses
ci{     change inside curly braces
da{     delete around curly braces
dit     delete inside HTML/XML tag
dat     delete around HTML/XML tag

Text Objects

Text objects are used after an operator or in visual mode to select a region.

Text ObjectDescription
iwinner word
awa word (with surrounding whitespace)
i"inside double quotes
a"around double quotes
i'inside single quotes
a'around single quotes
i`inside backticks
a`around backticks
i( or ibinside parentheses
a( or abaround parentheses
i{ or iBinside curly braces
a{ or aBaround curly braces
i[inside square brackets
a[around square brackets
itinside HTML/XML tag
ataround HTML/XML tag

Insert Mode Commands

These commands transition from normal mode to insert mode at various positions.

KeyAction
iinsert before cursor
ainsert after cursor
Iinsert at beginning of line
Ainsert at end of line
oopen new line below and insert
Oopen new line above and insert
ssubstitute character (delete char and enter insert)
Ssubstitute line (delete line content and enter insert)
Cchange to end of line

Press Esc or Ctrl-[ to return to normal mode from insert mode.

Visual Mode Commands

KeyAction
venter character-wise visual mode
Venter line-wise visual mode
Ctrl-venter block (column) visual mode
omove cursor to other end of selection (in visual mode)
gvreselect last visual selection

In visual mode, use motions to extend the selection, then apply an operator (d, c, y, >, <) to act on the selected text.

KeyAction
/search forward
?search backward
nrepeat last search in same direction
Nrepeat last search in opposite direction
*search forward for word under cursor
#search backward for word under cursor

Search accepts regular expressions. Press Enter to execute the search, Esc to cancel.

Marks

Marks save cursor positions that you can jump back to later.

KeyAction
m{a-z}set mark {a-z} at current position
'{a-z}jump to the line of mark {a-z}
`{a-z}jump to the exact position of mark {a-z}

📝 Note

Marks in @replit/codemirror-vim are buffer-local. Global marks (uppercase A-Z) may have limited support.

Registers

Registers are named storage locations for yanked or deleted text.

KeyRegister
"{a-z}named registers (use before an operator or yank)
"0yank register (last yank)
"1"9numbered delete registers
"+system clipboard register
"*system selection register

To use a register, type " followed by the register name before a yank, delete, or put command.

"ayy    yank current line into register a
"ap     put (paste) from register a
"+yy    yank current line to system clipboard
"+p     paste from system clipboard

💡 Tip

See the Clipboard Integration page for how to make clipboard registers actually sync with the system clipboard.

Macros

Macros record a sequence of keystrokes and replay them.

KeyAction
q{a-z}start recording into register {a-z}
qstop recording (while recording)
@{a-z}replay macro from register {a-z}
@@replay the last executed macro

Macros can be prefixed with a count: 10@a replays the macro in register a ten times.

Repeat

KeyAction
.repeat the last change command

The dot command repeats the last editing action (insert, delete, change, etc.) including any motion or text object that was part of it.

Undo and Redo

KeyAction
uundo
Ctrl-rredo

Count Prefix

Most commands accept a numeric prefix that repeats the command or modifies its behavior.

5j      move down 5 lines
3dw     delete 3 words
10@a    replay macro a 10 times
4>>     indent 4 lines

The count is typed before the operator or motion. For operator commands, it multiplies with the motion count: 2d3w deletes 6 words.

Revision History