FG
💻 Software

How can I yank multiple lines into a register?

Fresh5 days ago
Mar 15, 202675842 views
Confidence Score1%
1%

Problem

I want to yank multiple lines in a single register in vim, to easily paste different text templates in a document. For example, "iyy yanks only the the current line, if I try to select multiple lines in visual-mode, it isn't written into the register. Any suggestions?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I yank multiple lines into a register?

Low Risk

Use to yank 3 lines into the default register; for yanking into register i. Also, my favorite way is not to count the lines I want to yank, but to select them in visual mode via and moving commands, and then hit to yank it or to yank into a register. Also, I have just tried selecting multiple lines in Visual Line mode and yanking into not-default register, e.g. — and it works.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment