One of the most common task that beginners struggle to do in Vim is copying and pasting a line.
In reality though, it is very simple.
Type "yy" to copy a line, then "p" to paste it into the other place.
Now if you have some time, let's take a closer look at what's happening there. To copy a line,
Escto be sure. Then copy the entire line by pressing
:help yy). Y stands for "
yank". Instead, you can also press
Y(shift + y) but I find the former a bit more convenient.
p. That will put the yanked line right under your cursor (on the next line). You can also paste before your current line by pressing the capital letter
P. Again, to get some help you can use
Hopefully that was helpful.
If you are serious about using Vim in your workflow, make sure to get familiar with the most popular plugins around there.
Have a productive day!
If you're interested in Vim but just don't know how to start, subscribe to this newsletter. You will get notified when the course is ready and get the latest updates and articles around Vim. Also you will get a free "Vim From Scratch" eBook!