I save quite a few lines into a named register "iy100l. I can then paste from that register just fine, "ip.

I close and reopen Vim then try to paste from that register again "ip but it's truncated to only 50 lines.

So I'm guessing .viminfo has a limit on the length of registers it will save but I couldn't find it documented. Is there a setting to increase the limit?


it can be configured with the " character of the viminfo option

From :help 'viminfo:

"   Maximum number of lines saved for each register.  Old name of
    the '<' item, with the disadvantage that you need to put a
    backslash before the ", otherwise it will be recognized as the
    start of a comment!
  • Details on those settings aren't directly under :help viminfo hence not finding them before, but your answer did set me looking in the right direction, clicking through to the viminfo option which can be directly accessed by :help 'viminfo' (note the apostrophes). – Simon George Jun 28 '17 at 10:31
  • Yes, true. Though the leading apostrophe is enough – Naumann Jun 28 '17 at 10:49

:help viminfo contains general information on the feature but not settings.

:help 'viminfo' (note the apostrophes) is the documentation on the actual option settings. The key bit is < which sets the max lines saved per register. You are also forced to set a value for ' (max files marks are saved for). While I was at it I increased s (max Kbytes saved per register).

So the bit you stick in your .vimrc:

set viminfo='50,<200,s100

  • As :help 'viminfo' says, the key bit is < rather than " because the latter is essentially deprecated. I'm preferring this answer to @Naumann's answer because his is a bit misleading unless he changes it. – davidvandebunte Nov 8 '18 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.