要复制/粘贴在vim中的默认缓冲区大小? [英] default buffer size to copy/paste in vim?

查看:181
本文介绍了要复制/粘贴在vim中的默认缓冲区大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从vim会话中复制150行以粘贴到另一个会话中.我首先想到的是去

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

150Y

我先做了:q,然后又做了vim (otherProgram).py,然后按了'p'.仅复制了50行. 因此,我回到了原始文档并执行了shift-v并选择了我想要的行,然后执行了y,转到了另一个文档,并执行了p.似乎它也没有优雅地复制,仍然只有50行.

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.

我开始认为vim的复制缓冲区有一些默认大小.我正在使用Mac OSX. 有没有办法找出是否存在某种默认缓冲区大小?有什么办法可以改变它?

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?

推荐答案

您似乎需要在.vimrc中放入这样的内容:

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

set viminfo='20,<1000

重要的部分是<1000,它表示您希望每个寄存器最多存储1000行.设置viminfo时显然需要'20部分,但与您所陈述的需求并不特别相关. (它表示记住标记的文件数.)

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.)

有关更多详细信息,请参见:help 'vi. viminfo字符串中可以指定很多附加参数.例如,您可能需要增加最大寄存器大小.默认值为10kb,如果还不够,请尝试将其增加到1000kb:

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

这篇关于要复制/粘贴在vim中的默认缓冲区大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆