FS#8675 - gvim produces errors when opening php files

Attached to Project: Arch Linux
Opened by lithium (lithium) - Saturday, 17 November 2007, 09:23 GMT
Last edited by Tobias Kieslich (tobias) - Thursday, 13 December 2007, 21:27 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Kieslich (tobias)
Architecture i686
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Opening a .php file in gvim will produce the following error:

E10: \ should be followed by /,? or &

The error occurs on lines 479,482,488-505,511-512,535 but gvim does not state of which file (probably /usr/share/vim/syntax/php.vim)


Package version: gvim 7.1.135-1


Steps to reproduce:

Open a php file in gvim (not vim).
This task depends upon

Closed by  Tobias Kieslich (tobias)
Thursday, 13 December 2007, 21:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  gvim in testing depends on vim
Comment by Roman Kyrylych (Romashka) - Saturday, 17 November 2007, 10:29 GMT
Try gvim 7.1.156-1 from Testing.
Comment by lithium (lithium) - Wednesday, 21 November 2007, 09:18 GMT
Same error occurs with gvim 7.1.156-1.
Comment by Tobias Kieslich (tobias) - Wednesday, 21 November 2007, 22:40 GMT
It's not a vim error, you probably have the highlighting plugin installed (please verify and report here!) and that is broken at the moment (upstream)
Or you have some custom setting in vimrc. Out of the box, vim + gvim work no problems.
Google the E10 error, there are some options
Comment by lithium (lithium) - Thursday, 22 November 2007, 04:31 GMT
I'm not sure what highlighting plugin you mean. All I did to install it was "pacman -S gvim". The only setting that I changed was adding "colorscheme darkblue" to the end of /etc/gvimrc.
Comment by Tobias Kieslich (tobias) - Thursday, 22 November 2007, 05:46 GMT
do a pacman -Q | grep vim and post it here, I can't reproduce that at all.
Comment by lithium (lithium) - Thursday, 22 November 2007, 08:42 GMT
$ pacman -Q | grep vim
gvim 7.1.156-1
Comment by Tobias Kieslich (tobias) - Thursday, 22 November 2007, 23:05 GMT
okay, I can't reproduce that, there is likely a weird setting involved, did you google the error?
Comment by lithium (lithium) - Friday, 23 November 2007, 01:00 GMT
Yes, but I couldn't find any solutions. It seems like a generic error message.
Comment by Tobias Kieslich (tobias) - Friday, 23 November 2007, 18:14 GMT
well maybe it is a certain php file that screws up, can you attach one offending file?
Comment by lithium (lithium) - Saturday, 24 November 2007, 08:29 GMT
<?php

echo "hello";

?>
Comment by Tobias Kieslich (tobias) - Monday, 26 November 2007, 18:03 GMT
Hm, I have no clue where that comes from or how to reproduce. You ar probably better off asking for that at the forums.
Comment by lithium (lithium) - Saturday, 01 December 2007, 04:57 GMT
Bug also occurs on my laptop also running arch with latest gvim. Output of pacman -Q | grep vim is same on laptop. You sure you can't reproduce this?
Comment by Travis Willard (Cerebral) - Saturday, 01 December 2007, 05:16 GMT
Unfortunately, I also can't confirm this problem:

-----------------8<-----------------8<-----------
$ cat > test.php
<?php

echo "hello";

?>
$ gvim test.php
$ # Note there are no errors! Opened fine...
$ pacman -Q | grep vim
gvim 7.1.156-1
vim 7.1.156-1
vim-colorsamplerpack 5.0-1
$ sudo bash
# echo "colorscheme darkblue" >> /etc/gvimrc
# gvim test.php
# # Again no errors.
#
-----------------8<-----------------8<-----------

Is there anything in ~/.vim/ or ~/.gvimrc? Attached the 'standard' gvimrc - don't know if that'll help you or not.
   gvimrc (1.7 KiB)
Comment by lithium (lithium) - Saturday, 01 December 2007, 07:41 GMT
Your attached gvimrc is the same as my gvimrc except that I put "colorscheme blue" in ~/.gvimrc and not in /etc/gvimrc. Also the output of pacman -Q | grep vim is ONLY gvim 7.1.156-1, not also vim 7.1.156-1.
Comment by Travis Willard (Cerebral) - Saturday, 01 December 2007, 13:17 GMT
I removed vim from my system, and I still can't reproduce the error. What's your output of the 'locale' command?
Comment by Nathan Jones (nj) - Saturday, 01 December 2007, 15:23 GMT
I think the problem is that the 'nocompatible' option is never set. Take a look at /etc/vimrc and /etc/gvimrc; only the vimrc has 'set nocompatible'. But lithium does not have vim installed, so he doesn't have /etc/vimrc. Cerebral, I'm guessing you have a .vimrc that sets nocompatible.

Steps to reproduce:
gvim test.php
:set compatible
:e
# should get errors

Also see :help E10 which explains why this happens.

You can try emailing the php.vim maintainer to see if he'll fix it for those who do use compatible.
Comment by lithium (lithium) - Saturday, 01 December 2007, 19:27 GMT
I'm a bit confused about the vim and gvim packages. Nathan, you say that I do not have vim installed but it clearly is, just not the vim package. That is, vim comes in the gvim package. So my question is why would one install both the gvim and vim packages when gvim includes vim and gvim?
Comment by Nathan Jones (nj) - Saturday, 01 December 2007, 20:07 GMT
The gvim package does not provide the console vim executable.

$ pacman -R vim gvim
$ pacman -S gvim
$ vim
zsh: command not found: vim
Comment by lithium (lithium) - Saturday, 01 December 2007, 20:24 GMT
Sure it does, it's just called "vi" not "vim" (and yes, it is actually vim).
Comment by lithium (lithium) - Saturday, 01 December 2007, 20:42 GMT
Doing ":set nocompatible" before opening file does fix the issue.
Comment by Nathan Jones (nj) - Saturday, 01 December 2007, 20:58 GMT
The vi package provides the vi program which is slightly different from the vim program. vi looks for virc files, and vim looks for vimrc. Also, vim is compiled with more options, like cscope, python/ruby/perl interpretors, and X registers.

Take a look at the PKGBUILD's for all the differences:
http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/base/vi/PKGBUILD?rev=1.16&cvsroot=Core&only_with_tag=CURRENT&content-type=text/vnd.viewcvs-markup
http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/editors/vim/PKGBUILD?rev=1.14&cvsroot=Extra&only_with_tag=CURRENT&content-type=text/vnd.viewcvs-markup
Comment by Tobias Kieslich (tobias) - Saturday, 01 December 2007, 22:33 GMT
okay, to explain what we have here:
1. we ship a vi as vi comaptible version to have a sufficient version of the editor in base,; however vi serves as container to ship the complete vim runtime which is also used by vim and gvim. Vi doe snot com with vim* binaries to avoid conflicts and confusuion
2. we ship a vim, that has everything to make console and X-based terminal users happy, how ever the vim binary is VERY close to the gvim binary
3. the gvim binary is essentially the vim binary linked against GTK2 everything else is the same.

What can not be done:
1. Tinker around with php.vim and others. We would have to alter to many files in the binary. and it just creates conflicts.

What can be done:
1. set nocompatible in /etc/gvimrc (easiest fix, a bit dirty though)
2. drastic change: drop vim package; provide vim as binary in gvim package and gvim as symlink, the way vim is supposed to work.
3. provide a vim package WITH a gvim compatible binray, and a dummy gvim package that provides only a gvim symlink to vim and a /etc/gvimrc, and a bunch of gvim* related symlinks to manpages
4. cleanest way IMHO, make gvim dependent on vim again, technically not necessary but this way we make sure /etc/vimrc with the necessary stuff is present
Comment by lithium (lithium) - Saturday, 01 December 2007, 23:10 GMT
Wow, it's a lot more complex than I thought. In either case it doesn't really make sense to have an executable called "vi" running with as non-vi-compatible and an executable called gVIM which uses the vi settings and not the vim ones.

In case it still matters:
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=C
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Loading...