Vi mode: option for yank/put to use the system clipboard (like Vim's clipboard=unnamed)
Feature description
When vim editing mode is enabled, yank (y, yy) and put (p, P) operate on an internal register that is separate from the OS clipboard. The same applies to the other operations that write to the register: delete (d, dd, x, X), change (c, cc, s, S), and their variants. There is currently no way to bridge the two: text yanked or deleted in the prompt can't be pasted into other apps, and text copied elsewhere can't be put with p.
I'd like a setting that makes all register-writing vi-mode operations (yank, delete, change) and put read and write the system clipboard, mirroring Vim's set clipboard=unnamed (or unnamedplus), where the unnamed register is synced with the clipboard for every operation that touches it. For example:
{
"vimClipboard": "system"
}
with the default remaining the current internal-register behavior.
Why
For long-time Vim users the register model is muscle memory: yank or dd-cut something, switch context, put it. Right now that workflow silently breaks at the app boundary. Cmd+V works for pasting into the prompt, but it bypasses vi mode entirely, and there's no equivalent for getting yanked text out. The keybindings docs also state vim motions aren't remappable via keybindings.json, so there's no user-side workaround.
Alternatives considered
Cmd+C/Cmd+Vvia the terminal: works but ignores vi registers, and terminal selection copies the rendered prompt including wrapping artifacts.- Remapping via
~/.claude/keybindings.json: not possible; vim motions are explicitly not remappable. - The community
/yankskill: gives the model clipboard access but isn't an editor-level integration.
Environment
- Claude Code version: 2.1.201
- Platform: macOS
- Editor mode: vim (
/vim)