dd to copy a line into my paste buffer. Then I go to a new location.
I want to replace a line that I see. So I type
Is there an easier way (fewer keystrokes)?
Another way to do this would be
Might not be shorter in terms of keystrokes, but knowing this is an option can be very helpful!
Angus and Thor have the short answers covered, so here's some bonus exploration.
If for some reason you want to delete before pasting, you can take advantage of the numbered registers. The
Suppose you want to replace line 1 by 3 than you could do
This effectively moves line 1 to line 3, and removes line 2 (i.e. the old line 3)