default buffer size to copy/paste in vim?
Solution 1
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
Solution 2
For me this command:
set viminfo=<1000
throws an error:
E528: Must specify a ' value: viminfo=<1000
use a full string in your .vimrc file:
set viminfo='50,<1000,s100,h
- second value - max number of lines to copy
to check your last value (in vim):
:verbose set viminfo?
Related videos on Youtube
Comments
-
corvid over 1 year
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
, thenvim (otherProgram).py
, and pressed 'p'. Only 50 lines copied over. So I went back to my original document and didshift-v
and selected the lines I wanted then didy
, went to the other document, and didp
. 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?
-
Kent over 10 yearswhat did you do by "went back, went to"? why you
:q
, you could:e (otherprogram).py
-
-
Ingo Karkat over 10 yearsAlso, append
,s1000
to bump the default limit of 10kb to e.g. 1000kb. -
olovb about 9 yearsAs stated in another answer, this results in an error:
E528: Must specify a ' value: viminfo=<1000
-
pattivacek about 9 years@olovb, you are correct that leaving out the
'20
results in an error. I was using it in my own.vimrc
but hadn't previously realized that it was required! -
Thomas Guyot-Sionnest almost 4 yearsThe parameters are explained here: vimhelp.org/options.txt.html#%27viminfo%27
-
Louis Maddox almost 3 yearsSee also this answer and comments/links therein
-
WestCoastProjects over 2 yearsworks great. I used
set viminfo='20,<10000,s10000
to get max 10K lines and 10MB