03 January 2009

"Error ... ../php.vim" Update

I wrote about this annoying "E10" error once before. It doesn't crash anything, it just gives a long error message and pause (/"Enter to continue") every time you open a php file in vim with syntax high-lighting enabled. It's probably triggered by other syntax rule files as well. (Several variants of vim are found in FreeBSD ports under the editors category.)

I wrote to the port maintainer and he pointed out that the "problem" file, "php.vim", is not modified by the ports system. So, I poked around the vim site -- I couldn't possibly be the only person who's run into this -- and I found a setting that can prevent this problem. The E10 error message is described here. The issue is simply a vi-compatibility option that prevents vim from allowing backslashed line-continuations in sourced files (like the php.vim syntax rules script). The error will no longer appear when you disable this option with this vim command:
:set cpo-=C
... which can be put into your vimrc file. Which should be "~/.vimrc" for your personal startup file and "/usr/local/share/vim/vimrc" for the system-wide file. (You may need to create the system-wide file.) ... A much more elegant solution than modifying the php.vim file!

With great functionality comes great complexity.

Still, there's a better solution that avoids the error from the beginning regardless of the 'cpo' options: the vim developers ought to modify the php.vim file to remove the backslashed line-continuations. I'm all for neatly formatted code -- but not at the expense of user irritation!

Labels:

13 Comments:

At 22/1/09 18:07, Anonymous Anonymous said...

just thank you very much :D

 
At 23/2/09 23:24, Anonymous Anonymous said...

This helped me get past the irritation of that error as well, thank you!

 
At 23/2/09 23:57, Blogger kace said...

Glad to have helped! And thanks for the feedback.

 
At 10/3/09 20:25, Anonymous Anonymous said...

Thanks! This was very helpful, solved my problem.

 
At 2/4/09 01:58, Anonymous RanchoX said...

:help E10

 
At 15/4/09 07:11, Anonymous sampablokuper said...

I was setting up Vim in my home directory on a SunOS system when I ran into this problem. Thanks for your solution!

 
At 12/6/09 13:13, Blogger joao said...

Thx a lot!

 
At 3/7/09 07:31, Anonymous Anonymous said...

You are a star. Very helpful.

 
At 24/9/09 14:02, Anonymous Anonymous said...

I'll add my thanks too. Very helpful!

 
At 24/9/09 21:06, Blogger kace said...

You're welcome. And, thanks to everyone for the positive feedback. It really is gratifying to find out that this blog has been useful to someone! :)

 
At 26/10/09 06:39, Blogger ELOI said...

Many thanks for posting this and saving all some time!

 
At 1/2/11 11:43, Anonymous Anonymous said...

yeah, thanks man

 
At 30/1/13 07:48, Blogger Александр Ишмурадов said...

Thanks!
the alternative (more intuitive) syntax:

~/.vimrc:

set nocompatible

 

Post a Comment

<< Home