Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I often want to copy a line and replace another line with the pasted copy. Is there a better way than Y on source line, go to the line that has to be replaced and Pjdd?
You can go to the source line, yank it with yy or Y, go back to the target line, and press Vp (select the line with a visual selection, and replace the visual selection with the previously yanked line).
Required, but never shown