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.
Written by Jan Dudulski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#