Re:Emacs: The Editor for the Next Forty Years [video]
by balnaphone on Wednesday November 27, 2019 @01:03PM
(#21650283)
For the equivalent of vi's 'yyp', you must do C-a C-k C-k C-y C-y, or more likely 'C-akkyy'.
The first C-k only kills to end-of-line, to capture the line ending (\n) you need another C-k. The first C-y only puts back what you killed, so that needs to be doubled also to actually change the buffer in the desired way.
Subsequent C-y commands will add more copies of the line, but I find that 99% of the time it's only a single duplicate of a line that I want.
C-S-Backspace C-yy does the same thing, btw.
If you want to bind it to a key you could record that as a macro for e.g., but I find that sequence is simple enough that I don't think hard about it