Vim Recall繁體中文

Copy a line to the system clipboard

"+yy

Example

Normal 0 / 2
one two
three four
Cursor on line 1, column 1

Yank the current line into clipboard register +.

Vim registers

+ Simulated system clipboard (+)
Linewise · ↵ marks a line breakprevious↵
· space ⇥ tab ↵ line break

SIMULATED clipboard

Provider
Assumed available; no host clipboard is read or written
+ register
previous
Before & after
Before
one two
three four
Cursor on line 1, column 1

Vim registers

+ Simulated system clipboard (+)
Linewise · ↵ marks a line breakprevious↵
· space ⇥ tab ↵ line break

SIMULATED clipboard

Provider
Assumed available; no host clipboard is read or written
+ register
previous
After
one two
three four
Cursor on line 1, column 1

Vim registers

+ Simulated system clipboard (+) Changed
Linewise · ↵ marks a line breakone·two↵
· space ⇥ tab ↵ line break

SIMULATED clipboard

Provider
Assumed available; no host clipboard is read or written
+ register
one two

ILLUSTRATION. Assume a working +clipboard provider. The + register shown is simulated; yank the first line.

Details & Vim help

Yank the current line into clipboard register +.

This works only when the Vim build and environment support a system clipboard provider. It is standard Vim syntax, but clipboard availability varies across terminals and remote sessions.