P only pastes the last thing you yanked (
vim has the ability to copy thinks to particular register, where you can store texts to use them later. Each letter in the keyboard corresponds to a particular register.
Copy/pasting inside vim
Example: to save something to a a register, highlight it then,
"ay. Now, we have addressed the register a by typing
"a and combining with
y we have yanked(copied) to that register. Then similarly to paste in something from a particular register
Copy/pasting outside of vim
By default vim(command line vim) does not have access to the computers clipboard. Gvim(the graphical version of vim) has access to computers clipboard. To use the the computers clipboard in normal vim,
+ buffer/register can be used. So,
"+y to yank to the + register. Now it is copied to computers clipboard, and paste it in the traditional way (
ctrl + v)
To paste something copied outside of vim
Modify the vim rc for fast copy pasting
P as it pastes before the letter on cursor.
p pastes after a letter.