claude-code - 💡(How to fix) Fix Vim mode: support system clipboard registers ("*, "+) or clipboard=unnamed for cross-prompt yank/paste [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54756Fetched 2026-04-30 06:36:53
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

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=unnamedplus setting equivalent
  • No :registers introspection
  • 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)

  1. clipboard=unnamed parity — a settings.json key like "vimClipboardUnnamed": true that routes y/yy to the system clipboard automatically. Lowest-friction option.
  2. Explicit system clipboard registers — recognize "* and "+ so users can opt in per-yank with "*yy and paste with "*p.
  3. 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.

extent analysis

TL;DR

To fix the issue, implement one of the suggested fixes, such as adding a settings.json key for vimClipboardUnnamed or recognizing explicit system clipboard registers.

Guidance

  • Consider adding a "vimClipboardUnnamed": true key to settings.json to route y/yy to the system clipboard automatically.
  • Alternatively, recognize "* and "+ registers to allow users to opt-in per-yank with "*yy and paste with "*p.
  • Another option is to keep the last-yanked text in the unnamed register across submissions within a session.

Example

No code snippet is provided as the issue is more related to feature implementation rather than a specific code fix.

Notes

The chosen solution should be based on the specific requirements and user experience goals of the application, considering factors such as user friction and consistency with standard vim behavior.

Recommendation

Apply a workaround by implementing the "vimClipboardUnnamed": true setting, as it seems to be the lowest-friction option and aligns with standard vim behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING