Skip to main content
Vim mode gives the Claude Code prompt input a modal editing model based on Neovim/Vim conventions. It applies to the prompt input field only — not to the conversation output displayed above it.

Enabling vim mode

Toggle vim mode with the /vim slash command. The change takes effect immediately and persists across sessions.
/vim
You can also enable it in your Claude Code settings.

Modes

Claude Code vim mode implements three modes:
ModeIndicatorDescription
INSERT-- INSERT --Text is typed directly into the prompt (default when vim mode is off)
NORMAL-- NORMAL --Keystrokes are interpreted as commands — movement, operators, etc.
VISUAL-- VISUAL --Character-wise text selection
Claude Code starts in INSERT mode. Press Escape from INSERT mode to enter NORMAL mode.

Normal mode

Entering insert mode

KeyAction
iEnter INSERT before the cursor
aEnter INSERT after the cursor
IEnter INSERT at the first non-blank character of the line
AEnter INSERT at the end of the line
oOpen a new line below and enter INSERT
OOpen a new line above and enter INSERT

Motions

Motions move the cursor. They can be prefixed with a count (e.g., 3w moves forward three words). Character and line movement
KeyAction
hMove left one character
lMove right one character
jMove down one logical line
kMove up one logical line
gjMove down one visual (wrapped) line
gkMove up one visual (wrapped) line
Word movement
KeyAction
wMove to the start of the next word
bMove to the start of the previous word
eMove to the end of the current or next word
WMove to the start of the next WORD (whitespace-delimited)
BMove to the start of the previous WORD
EMove to the end of the current or next WORD
Line positions
KeyAction
0Move to the start of the line
^Move to the first non-blank character of the line
$Move to the end of the line
Buffer positions
KeyAction
ggMove to the beginning of the buffer
GMove to the last line (or line N with count prefix)
Character find
KeyAction
f{char}Move to the next occurrence of {char} on the line
F{char}Move to the previous occurrence of {char} on the line
t{char}Move to just before the next occurrence of {char}
T{char}Move to just after the previous occurrence of {char}
;Repeat the last find in the same direction
,Repeat the last find in the opposite direction

Operators

Operators act on a range of text defined by a motion or text object. The pattern is {operator}{motion} or {operator}{text-object}.
OperatorKeyDescription
DeletedDelete the text in the range and place it in the register
ChangecDelete the text in the range and enter INSERT mode
YankyCopy the text in the range into the register
Doubling the operator key acts on the current line: dd deletes the line, cc changes the line, yy yanks the line. Shorthand operators
KeyEquivalentDescription
Dd$Delete from cursor to end of line
Cc$Change from cursor to end of line
YyyYank the current line
xdlDelete the character under the cursor

Paste

KeyAction
pPaste the register contents after the cursor
PPaste the register contents before the cursor

Other normal mode commands

KeyAction
r{char}Replace the character under the cursor with {char}
~Toggle the case of the character under the cursor
JJoin the current line with the line below
uUndo the last change
.Repeat the last change
>>Indent the current line
<<De-indent the current line

Text objects

Text objects define a structured range of text. They are used after an operator in the form {operator}{scope}{object}, where scope is i (inner) or a (around/outer). Word objects
ObjectInner (i)Around (a)
wWord characters onlyWord plus surrounding whitespace
WWORD characters onlyWORD plus surrounding whitespace
Delimiter objects
ObjectInner (i)Around (a)
"Contents inside double quotesContents plus the quote characters
'Contents inside single quotesContents plus the quote characters
`Contents inside backticksContents plus the backtick characters
( or ) or bContents inside parenthesesContents plus the parentheses
[ or ]Contents inside bracketsContents plus the brackets
{ or } or BContents inside bracesContents plus the braces
< or >Contents inside angle bracketsContents plus the angle brackets
Examples
diw   — delete inner word (the word under the cursor)
ca"   — change around double quotes (including the quotes)
yi(   — yank inner parentheses (the contents, not the parens)
da{   — delete around braces (contents and the braces)

Visual mode

KeyAction
vEnter character-wise VISUAL mode
EscapeReturn to NORMAL mode
In VISUAL mode, motions extend the selection. Press an operator key (d, c, y) to act on the selected text.

Count prefixes

Most motions and operators accept a numeric count prefix that repeats the action. Type the count before the key:
3w      — move forward 3 words
5j      — move down 5 lines
2dd     — delete 2 lines
4f,     — move to the 4th comma on the line
The maximum supported count is 10000.

Scope

Vim mode applies to the prompt input field only. The conversation output above the input is not affected by vim mode and uses the standard scroll keybindings (Page Up, Page Down, Ctrl+Home, Ctrl+End) regardless of the current vim mode.
While in NORMAL mode, Enter executes the vim command buffer rather than submitting the prompt. Switch to INSERT mode before pressing Enter to submit, or use the chat:submit keybinding directly.

Build docs developers (and LLMs) love