I don't really know a better way to describe this, but copying multiple lines in Visual Mode flat out doesn't work. I hit V, highlight the lines, hit y, and then it will tell me "31 lines yanked" (or however many I copied) but then when I go to paste it only puts down the first 2 lines. And one of those lines wasn't even highlighted.

Does anyone have any clue how I can get this text editor to actually do its job? This is some pretty basic stuff and shouldn't be this difficult.

  • how are you "pasting?"
    – Mass
    Feb 23, 2018 at 18:57
  • 'p' is how I'm pasting. Feb 23, 2018 at 19:02
  • 1
    it would help to provide an animation + your configuration details. your problem cannot be produced with the level of detail given
    – Mass
    Feb 23, 2018 at 19:32
  • 2
    check :reg output after pasting. Also check TextYankPost autocommand, and your mappings for y. You could alternatively try to use :norm! gvy Feb 23, 2018 at 20:25

3 Answers 3


I had this issue as well. My problem is that I was using yy to yank the lines instead of just a single y.

Highlighting a block and then hitting yy followed by p where I wanted to paste reproduced this problem (ie only pasted two lines).

Again, the fix is to only use a single y after selecting with V, and then the p should work normally.


this is not the expected behavior - perhaps you have something mapped in such a way that it causes this behavior.

try starting vim using vim -u /dev/null -U /dev/null --noplugin

then, assuming the expected behavior, you can divide and conquer in your .vimrc, .gvimrc and plugins.

  • 1
    Upvoted because I think this gets to the heart of the problem, but I would note that -U specifies the location of gvimrc, and so isn't necessary or useful in this command, and that NONE is better than /dev/null as it's provided by Vim itself so will work reliably in all operating systems. Using -u NONE also skips loading plugins, so --noplugin is then not required, either. I usually use vim -Nu NONE in order to (un)set nocompatible, too.
    – Rich
    Feb 26, 2018 at 10:04
  • @rich - you are absolutely correct. primarily, i added these to draw attention to their presence/relevance to the orig question. using NONE is certainly the correct usage with the exception of NONE in -u (lower case) - it has the (unwanted?) side effect of enabling 'compatible', causing other wackiness. it should also be noted that using NORC is the same as NONE except plugins are loaded, hence the inclusion of '--noplugin. from a technical and cleanliness standpoint, tho, your comment is well taken.
    – wmmso
    Feb 26, 2018 at 18:53

Try to paste the copied lines with P instead of p

For example, duplicate all lines: ggVG y P works for me. If I use p, it only duplicates the first line, not sure why.

I am using the Vim extension in VSCode, could it be a reason why?

  • The only difference between p and P should be if you paste before or after the cursor. Maybe p gets remapped somewhere? I don't know how to check in the VSCode extension, but you can use nmap p in regular Vim. Jul 5, 2022 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.