Implement more Vim motions and shortcuts (`f`, `t` etc)
Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened May 21, 2025 · closed Jan 14, 2026
Claude Code is currently missing some very useful Vim movements and other Vim shortcuts. Everyone has their favourites, and you probably can't implement them all.
These ones here would make is significantly faster to move the cursor around:
- [x]
f/Ffor jumping to next/prev character in a line ✅ - [x]
t/Tfor jumping to just before next/prev character in a line ✅ - [x]
;and,to repeat previousf/Fmovement forward / backward ;and,to repeat previoust/Tmovement forward / backward
- [x] (and combined with
d/cetc make editing a lot easier)
Some more that would be really useful for editing:
- [x]
ciw✅,yiw,diw✅ etc for operating on 'inner word's - [x] yanking text with any of the yank motions (
Y,yy,yiw,yf{letter}, etc) - [x] pasting with
porPin normal mode. Currently it seems you have to enter insert mode to paste with Cmd-V
Some others which would also be handy:
- [x]
u✅ for undo! - [x]
>>/<<indent current line - [x] h
Jfor joining lines separated by space is handy
Some bugs that I'm aware of that are really annoying:
- BUG:
dwdeletes too far, it's not meant to delete the trailing newline character on the line - BUG:
aat the very end of a line does not work properly. Cursor ends up in the wrong position
Anyway, thanks so much for adding a Vim mode, it's a great feature. Creating and editing prompts is one of the bottlenecks now! The easier it is to do that the better IMO.
----
UPDATE: have been marking off some of these as they have been recently implemented.
9 Comments
I'll throw one in:
I just was wrapping up a very long prompt, and went to clear the last couple lines. I used dd and the entire prompt disappeared, and
udid not bring it back. It seems to be gone. Very frustrating. I thought it was going to only remove the last lines, becausekandjin normal mode jumped up and down lines, rather than having to typegjandgklike in vim. These subtleties matter!+👍 for
ci[w|W]I would appreciate a
jjto Escape mapping (maybe that could be customized, or you could read ~/.input.rc and look for vi-movement-mode). That's what I use in vim, and in the terminal command line and is very convenient to go to normal mode instead of pressing the escape key.Thanks for adding the vim mode btw! Even though it is not covering all the keys and motions it is working well!
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Can we have a
vshortcut to turn on visual mode, or open a temporary vim editor to edit the current prompt? Exit that editor would return to the prompt box. I have seen this in some other tools (can't remember the name), and they are super efficient, especially with long prompts where there are multilines and bullets, etc.--
UPDATE:
ctrl-gactually do the job, after I setEDITOR=vimin my~/.bashrcThis issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Upvote or comment on that issue, so maybe it gets noticed.
FWIW, most of my original list of vim motions have been implemented now.
How it handles newline characters is currently my biggest gripe, frustrating when it removes newlines characters when it shouldn't or positions the cursor on the wrong line etc.
But overall, it's much easier to work with now. Plus I
<ctrl>+ga lot now to use a full vim instance, mostly so I don't accidentally submit my prompt when typing out a lot of info.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.