I cc or 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 p Down dd.
Is there an easier way (fewer keystrokes)?
|
You can type |
|||
|
|
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
Try |
|||
|
|
|
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) |
|||
|
|
|
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! |
|||
|
|
Vto select the line, thenpto replace it. – angus Jul 14 '12 at 18:45