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?
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?
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
Stay in the same session (open the new file doing :e path) and you won't have any limitation.
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-=