vim in dapper fails at "syntax on"

Bug #24726 reported by Alan Tam
14
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Fix Released
High
Daniel Stone

Bug Description

sltam@beech:~$ head -1 .vimrc
syntax on
sltam@beech:~$ vim
Error detected while processing /home/sltam/.vimrc:
line 1:
E484: Can't open file /usr/share/vim/syntax/syntax.vim

"dpkg -L vim" shows that syntax.vim is in /usr/share/vim/vim64/syntax/

Revision history for this message
WillDyson (will-dyson) wrote :

Indeed several other things fail to work, as vim 6.4-001+2ubuntu2 still thinks
that $VIMRUNTIME is '/usr/share/vim/vim63'. This is because it still thinks its
version is 6.3.78.

You can set $VIMRUNTIME in your shell to work around this.

Revision history for this message
Alan Tam (at) wrote :

Tried:
sltam@beech~$ $VIMRUNTIME=/usr/share/vim/vim64 vim

It seems failed to honor my "syntax on" and others in /etc/vim/vimrc .

In addition, this key mapping (work in 6.3) fails:
:nmap m :make<CR>
When I press "m", it complains: E500: Evaluates to an empty string

But if I change it to
:nmap m :make
Then it works fine.

Setting severity to major since it causes major functionality loss.

Revision history for this message
Alan Tam (at) wrote :

The command I executed should be:
sltam@beech~$ VIMRUNTIME=/usr/share/vim/vim64 vim

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 25895 has been marked as a duplicate of this bug. ***

Revision history for this message
Martin Pitt (pitti) wrote :

I cannot reproduce this. vim works fine with my ancient-old .vimrc, in a fresh
profile without any .vimrc, and with a .vimrc that only contains 'syntax on'.
Maybe your .vimrc sets a specific VIMRUNTIME path? If you are unsure, just
attach your .vimrc if it does not contain any confidential information.

Revision history for this message
Alan Tam (at) wrote :

I just "mv .vimrc .vimrc-old", run "vim" and then ":syntax on", it shows:
E484: Can't open file /usr/share/vim/syntax/syntax.vim

I uncommented "syntax on" in /etc/vim/vimrc and run "vim", it shows:
sltam@maple:~$ vim
Error detected while processing /usr/share/vim/vimrc:
line 35:
E484: Can't open file /usr/share/vim/syntax/syntax.vimWarning: Color name
"#efebe7 " is not defined

I just tried "apt-get remove --purge vim" followed by "apt-get install vim" and
it is cured!

Probably something bad happened to the upgrade procedure?

Revision history for this message
Daniel Stone (daniels) wrote :

the latter sounds somewhat like mcpp troubles. are you running 2.5-1ubuntu1 of
mcpp or just 2.5-1?

Revision history for this message
Alan Tam (at) wrote :

2.5-1ubuntu1

When will vim use mcpp?

Revision history for this message
Daniel Stone (daniels) wrote :

xrdb uses it to manage X resources

Revision history for this message
Alan Tam (at) wrote :

I can't find how vim indirectly depend on xrdb.

Do you mean vim will ask xrdb for the path of vim runtime,
and it is mcpp that incorrectly reported /usr/share/vim instead of
/usr/share/vim/vim64 ?

Revision history for this message
Martin Pitt (pitti) wrote :

Reassigning to Daniel, you obviously already have a clue what's going on here.
It just works for me...

Revision history for this message
Vincent Untz (vuntz) wrote :

I also fail to see why xrdb would be the cause of the problem: it happens with
vim (the non-graphical version) too.

Also, it used to report version 6.3.xxx instead of 6.4.1 as version.

"apt-get remove --purge vim && apt-get install vim" does indeed solve the problem.

Revision history for this message
Daniel Stone (daniels) wrote :

err. i was talking about alan's troubles more than anything, with the space
after the colour. i have no idea about vim63 vs vim64 and am away all next
week, so don't look at me if you need a speedy resolution. ;)

Revision history for this message
WillDyson (will-dyson) wrote :

The problem seems to be the switch from using diversions to /etc/alternatives to
manage /usr/bin/vim. I don't know why I didn't think to look for this before,
but somehow the upgrade to 6.4 did not replace /usr/bin/vim with a symlink to
/etc/alternatives/vim. Nor did it remove the diversion of /usr/bin/vim to
/usr/bin/vim.org by vim-gnome.

So the reason that running "vim" reports a version of 6.3.78 is that the 6.3.78
vim-gnome binary is still sitting there at /usr/bin/vim!

Unfortunatly, I don't have the vim-gnome 6.3.78 prerm/postrm scripts handy to
troubleshoot right now.

Revision history for this message
WillDyson (will-dyson) wrote :

(In reply to comment #14)

> Unfortunatly, I don't have the vim-gnome 6.3.78 prerm/postrm scripts handy to
> troubleshoot right now.

I took a look, and it seems to me that none of the maintainer scripts even
attempt to remove the diversion on upgrade (only on remove, or failed-upgrade).

Interestingly, on my desktop system running debian unstable, the same upgrade
also left me with a stale diversion by vim-gnome (debian bug #341081). However,
in that case, the /usr/bin/vim binary was successfully removed and replaced with
a symlink to /etc/alternatives/vim. I never would have noticed the stale
diversion there if it wasn't for this problem on my laptop after moving to dapper.

If I revert back to 6.3-078+1ubuntu3 and try the upgrade again, I still get the
apparently harmless leftover diversion, but I cannot make vim-gnome leave behind
a copy of /usr/bin/vim. Perhaps the particular version of dpkg that I had
installed at that time made the difference?? I upgraded from breezy to dapper
very early on (almost as soon as breezy was released. I recall that vim was one
of the very first packages to be upgraded in dapper).

Revision history for this message
Alan Tam (at) wrote :

Mark as fixed since I no longer see it.

Changed in vim:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.