iamnearlythere

Yanking in Vim

A common pattern while editing is to yank anything (i.e. yy), visually select what you want to remove (i.e. vj) and paste (p). This will in turn place the overwritten test in the yank register; but we wanted to paste that same line again!

Type :reg to see all currently populated registers, they're all preceded by ". This means that you can paste by visually selecting and typing "0p if "0 is the register's content you want to paste.

Comments