tags:

views:

114

answers:

3

im trying to copy 300 lines from one file to another, in source file i type "300yy", it says it has yanked 300 lines.

go to destination file and press p, it pastes, but only the first 50 lines.

any idea why it isn't pasting the 300?

+4  A: 

A solution from the Vim Tips Wiki:

:help 'viminfo'
 ...
 <       Maximum number of lines saved for each register.
 ...
 :set viminfo?
 :set viminfo='100,<100,s10,h
eugene y
do you know what each one of those '100,<100,s10,h lines mean?
Hermann Ingjaldsson
@Hermann: Just run the `:help 'viminfo'` command in vim
eugene y
this is a vastly superior documentation of the solution to those problems.
Hermann Ingjaldsson
Just a quick note that ":help viminfo" and ":help 'viminfo'" pull up different helps. The latter is the one that you need.
Jeet
+2  A: 

Stay in the same session (open the new file doing :e path) and you won't have any limitation.

mb14
+2  A: 

As Eugene and Zyx said adjusting your viminfo would be the easiest solution

:set viminfo-=<50,s10

An alternate solution would be use :read and/or :write

To read in from file-name.txt into the current buffer

:read file-name.txt

To append the range of line 1 to line 300 from the current buffer to file-to-append.txt

:1,300write >> file-to-append.txt

You can also use marks instead of line numbers such as the visual marks

:'<,'>write >> file-to-append.txt

Of course appending may not be able to fulfill your use case in which the viminfo changes will probably work best.

:help :write
:help :read
:help 'viminfo'
:help :set-=
Peter Rincker
before switching from vi to vim I set the following abbrevation (don't remember why I used ab instead of map) : `cab wbf w! ~/.lastbuffer` and `rbf r ~/.lastbuffer` which respectively write and read always the same file. Then just do `:wbf` and `:rbf`
mb14