~ / registers
7
Registers
Vim's many clipboards: the unnamed register, named registers, the yank register, the black hole and appending.
- 01
The unnamed register: x, dd, yy and p
Every delete and yank lands in one shared register, and p puts it back.
xddyypPxpddpyypnvim - 02
Named registers: "a to "z
Stash text under a letter so later deletes can't touch it; capitals append.
"{a-z}"ayy"ap"Ayy:regnvim - 03
The yank register "0 and the black hole "_
Get your last yank back after a delete, or delete without touching any register.
"0p"_d{motion}"_dd"1p"-pnvim - 04
Replace a selection with p (and P)
Select text and put over it; the old text drops into the unnamed register.
viwpVpv{motion}Pv{motion}"0pnvim - 05
More ways to put: gp, ]p, counts and Ctrl-r
Choose where the cursor lands, match indentation, and paste while typing.
gpgP]p[p{count}p<C-r>{reg}nvim