Last Updated: February 25, 2016
·
552
· jandudulski

VimTip#3: yank and paste in place

If you want to copy a line and paste in the same file you can simply run:

:10copy.

Which means copy line number 10 and put it here (. means current line). You can pass any number instead dot of course.

Vim also has a shorter synonym for a copy command which is just t, so you can run:

:10t.

If you're using relativenumber you can use them too:

:+5t.

At last, but not least - if you don't like numbers, you can just search!

:/pattern/t. 

credits