Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am proficient at using Unix/Linux, but I am not an expert. If I want to open a file (for example, file.txt), I use vi:

vi file.txt

This opens the file, and if I want to close it, I use :q!. I have been using this method for the two years that I have been using Unix/Linux. My institution has a cluster running Ubuntu Linux.

Today, however, I tried to open a file, and I got these error messages:

E576: viminfo: Missing '>' in line: newest to oldest):
E576: viminfo: Missing '>' in line: ?/CJ
E576: viminfo: Missing '>' in line: ?/CG
E576: viminfo: Missing '>' in line: ?/CC
E576: viminfo: Missing '>' in line: ?/OEP
E576: viminfo: Missing '>' in line: ?/CEP
E576: viminfo: Missing '>' in line: ?/dih
E576: viminfo: Missing '>' in line: ?/ang
E576: viminfo: Missing '>' in line: ??b
E576: viminfo: Missing '>' in line: ?/xvg
E136: viminfo: Too many errors, skipping rest of file
Press ENTER or type command to continue

So I press Enter. I get the same messages:

E576: viminfo: Missing '>' in line: newest to oldest):
E576: viminfo: Missing '>' in line: ?/CJ
E576: viminfo: Missing '>' in line: ?/CG
E576: viminfo: Missing '>' in line: ?/CC
E576: viminfo: Missing '>' in line: ?/OEP
E576: viminfo: Missing '>' in line: ?/CEP
E576: viminfo: Missing '>' in line: ?/dih
E576: viminfo: Missing '>' in line: ?/ang
E576: viminfo: Missing '>' in line: ??b
E576: viminfo: Missing '>' in line: ?/xvg
E136: viminfo: Too many errors, skipping rest of file
Press ENTER or type command to continue

Again I press Enter, and finally the file opens for reading/editing. However, the problem repeats when I try to close the file using :q!, and also when I try to open any other file using vi.

The key words CJ, CG, CC, OEP, CEP, dih, ang, and xvg (I am not sure about b, though) are all strings that often appear in files that I read using vi, although I am not certain that they all exist in the particular file that I am opening (I do not think so). Thus, perhaps something is wrong with my viminfo file? However, I am using vi, not vim.

I am not sure what has happened; do you have any suggestions of how I can diagnose, and possibly fix, this problem?

share|improve this question
2  
Is your ~/.viminfo corrupt? Try moving it elsewhere and see if the problem returns. Keep in mind many systems that provide vim simply provide vi as a symlink to vim. –  jw013 Dec 21 '12 at 22:44
2  
I am using vi, not vim. Are you sure? vi is often aliased to vim (check with which vi and then file on that location). –  ire_and_curses Dec 21 '12 at 22:48
2  
On most linux systems, vi is a symlink to vim, so you might have a corrupt viminfo. –  Mark Cohen Dec 22 '12 at 1:55
    
@ire_and_curses Thanks! When I enter which vi, I get the output /usr/bin/vi. When I enter file /usr/bin/vi, I obtain the output /usr/bin/vi: symbolic link to /etc/alternatives/vi'. Does this mean I am using vi`? –  Andrew Dec 22 '12 at 16:47
1  
@Andrew - Ok, so do file /etc/alternatives/vi. I expect that will tell you you are actually running vim. –  ire_and_curses Dec 22 '12 at 21:12

2 Answers 2

up vote 12 down vote accepted

Do this:

rm -f ~/.viminfo

The .viminfo file keeps metadata about various useful, but non-critical state information. Yours is corrupt. Remove it.

share|improve this answer
2  
It would be more risk averse to move .viminfo rather than remove it. For example if you are working on a large code-base it may be very painful to reconstruct your marks. –  donothingsuccessfully Dec 22 '12 at 7:54
    
@bahamat @donothingsuccessfully Thanks to all for your time! Moving .viminfo (risk averse method) fixes the problem. So I guess my .viminfo file was corrupted. Sincere thanks for your help. Happy Holidays! –  Andrew Dec 23 '12 at 17:39

The vim error E576 happens when you've some syntax error in your .viminfo file which stores your command and file history, etc.

The corruption may happen when you're out-of-space or your storage engine is faulty. You may try to edit ~/.viminfo, locate and remove the invalid lines, eventually to rename it to different name and just to remove it.

You also can use -i {viminfo} parameter to specify the different .viminfo file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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