Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default buffer size to copy/paste in vim?

Tags:

I was trying to copy 150 lines from a vim session to paste into another. My first thought was to go for

150Y 

I did :q, then vim (otherProgram).py, and pressed 'p'. Only 50 lines copied over. So I went back to my original document and did shift-vand selected the lines I wanted then did y, went to the other document, and did p. It seemed that it did not copy over gracefully either, still only being 50 lines.

I'm starting to think that there is some default size for vim's copy buffer. I am using Mac OS X. Would there be any way to find out if there is some kind of default buffer size? Is there any way to change it?

like image 709
corvid Avatar asked Jul 23 '13 13:07

corvid


People also ask

Can you copy paste in Vim?

Press d to cut (or y to copy). Move to where you would like to paste. Press P to paste before the cursor, or p to paste after.

How do I copy an entire text in Vim?

You can use a movement command or up, down, right, and left arrow keys. Press y to copy, or d to cut the selection. Move the cursor to the location where you want to paste the contents. Press P to paste the contents before the cursor, or p to paste it after the cursor.


1 Answers

It looks like you need to put something like this in your .vimrc:

set viminfo='20,<1000 

The important part is the <1000, which indicates that you want your registers to store up to 1000 lines each. The '20 part is apparently required when setting viminfo but is not particularly relevant for your stated needs. (It indicates that number of files for which marks are remembered.)

See :help 'vi for further details. There are plenty of additional parameters that can be specified in the viminfo string. For example, you may need to increase the maximum register size. The default is 10kb, if that isn't enough, try this to increase it to 1000kb:

set viminfo='20,<1000,s1000 
like image 132
pattivacek Avatar answered Oct 17 '22 00:10

pattivacek