Vim mode: support system clipboard registers ("*, "+) or clipboard=unnamed for cross-prompt yank/paste
Problem
In vim mode, yy yanks to an internal register that's destroyed when the prompt is submitted. There's no way to preserve the yanked text for p at the next prompt. This breaks the most common vim composition pattern (yank fragment from one input, paste into another).
What's missing
The vim mode currently supports only the unnamed register. None of the standard vim register escape hatches exist:
- No system clipboard registers (
"*,"+) - No named registers (
"a–"z) - No
clipboard=unnamed/clipboard=unnamedplussetting equivalent - No
:registersintrospection - No cross-prompt persistence of even the unnamed register
So there's no way — within vim mode — to make yy then p (across a submission boundary) work.
Use case
Composing a prompt, realizing the wording is better suited for the next message, yanking it, submitting, then p at the new prompt. Standard vim muscle memory; currently impossible.
Suggested fix (any of these would solve it)
clipboard=unnamedparity — a settings.json key like"vimClipboardUnnamed": truethat routesy/yyto the system clipboard automatically. Lowest-friction option.- Explicit system clipboard registers — recognize
"*and"+so users can opt in per-yank with"*yyand paste with"*p. - Persistent unnamed register across prompts — keep the last-yanked text in the unnamed register across submissions within a session.
Related
- #5005 requests a general clipboard-copy shortcut for the current prompt — overlapping but distinct (this is about register semantics inside vim mode, not a one-shot copy keystroke).
Thanks — Claude Code's vim mode is otherwise excellent.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗