vim limited line memory

john-jones picture john-jones · Sep 9, 2010 · Viewed 24.4k times · Source

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?

Answer

Eugene Yarmash picture Eugene Yarmash · Sep 9, 2010

To see the current settings during a vim session, run:

:set viminfo?

As suggested in Vim Tips Wiki, you can adjust the viminfo setting (again, during a vim session) by running the ex-command:

:set viminfo='100,<1000,s100,h

or you can remove the : and set it as default in your .vimrc as:

set viminfo='100,<1000,s100,h

What the individual parts mean:

  • '100 Marks will be remembered for the last 100 edited files.
  • <1000 Limits the number of lines saved for each register to 1000 lines; if a register contains more than 1000 lines, only the first 1000 lines are saved.
  • s100 Registers with more than 100 KB of text are skipped.
  • h Disables search highlighting when Vim starts.