Vim Recall繁體中文

Yank the count lines [into register x]

yy

Example

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

Yank the count lines [into register x].

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
0 Yank register 0
Characterwisesaved
· space ⇥ tab ↵ line break
Before & after
Before
one
two
three
four
five
Cursor on line 1, column 1

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
0 Yank register 0
Characterwisesaved
· space ⇥ tab ↵ line break
After
one
two
three
four
five
Cursor on line 1, column 1

Vim registers

" Unnamed register Changed
Linewise · ↵ marks a line break · Uses Yank register 0one↵
0 Yank register 0 Changed
Linewise · ↵ marks a line breakone↵
· space ⇥ tab ↵ line break

Start in Normal mode. This is a text-buffer example; yanking copies lines without changing the buffer.

Details & Vim help

Example replayed in Vim

Yank the count lines [into register x]. Use in Normal mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.