Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim limited line memory

Tags:

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?

like image 797
john-jones Avatar asked Sep 09 '10 13:09

john-jones


People also ask

Does vim load entire file into memory?

Yes, Vim loads the whole file into memory.

How do I select the number of lines in Vim?

If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor. Finally, you can select text in columns by pressing ctrl+v and moving up or down the block.


1 Answers

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.
like image 133
Eugene Yarmash Avatar answered Oct 14 '22 15:10

Eugene Yarmash