You are not logged in.

#1 2008-09-26 00:58:17

nss
Member
Registered: 2007-05-08
Posts: 24

can't open file syntax.vim

I have vim installed from extra (x86_64). When I start vim I get the following error:

$ vim
Error detected while processing /etc/vimrc:
line   41:
E484: Can't open file /usr/share/vim/vimcurrent/syntax/syntax.vim
Error detected while processing /home/nsmoot/.vimrc:
line   63:
E484: Can't open file /usr/share/vim/vimcurrent/syntax/syntax.vim
Press ENTER or type command to continue

There is not a "current" directory on my system...

# find / -name "syntax.vim" -print
/usr/share/vim/syntax/syntax.vim

Offline

#2 2008-09-26 11:45:34

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: can't open file syntax.vim

The error message is perhaps a bit misleading. The error is on line 63 of file /home/nsmoot/.vimrc.

Edit /home/nsmoot/.vimrc and correct/comment line 63.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#3 2008-09-26 20:30:28

nss
Member
Registered: 2007-05-08
Posts: 24

Re: can't open file syntax.vim

I still get:

Error detected while processing /etc/vimrc:
line    41:
E484: Can't open file /usr/share/vim/vimcurrent/syntax/syntax.vim
Press ENTER or type command to continue

I guess I'll just add a symlink:

root@computer:/usr/share/vim # ln -s /usr/share/vim/ vimcurrent

Offline

#4 2008-10-29 19:52:12

mci_nano
Member
From: Germany/Braunschweig
Registered: 2008-10-26
Posts: 14

Re: can't open file syntax.vim

For me reinstalling "vi" (not vim) helped to get syntax highlighting in vim.

Offline

#5 2009-07-06 15:05:25

kesara10
Member
Registered: 2008-06-11
Posts: 13

Re: can't open file syntax.vim

re-installing all of vi, vim and gvim didn't help me but following did

sudo ln -s /usr/share/vim/syntax /usr/share/vim/vim72/syntax

Offline

#6 2009-07-06 15:19:11

kesara10
Member
Registered: 2008-06-11
Posts: 13

Re: can't open file syntax.vim

and add "export VIMRUNTIME=/usr/share/vim"

Offline

#7 2009-07-07 10:18:21

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: can't open file syntax.vim

I have the same problem and adding export VIMRUNTIME solved it for both my regular user as my root user but when using sudo I still get the error. Any ideas how to make it work for sudo as well?

Offline

#8 2009-07-07 10:57:11

iceman
Member
From: Turin
Registered: 2009-03-04
Posts: 5
Website

Re: can't open file syntax.vim

I did in this way:

cd /usr/share/vim/vim72
mv syntax syntax.old
ln -s /usr/share/vim/syntax /usr/share/vim/vim72/

In this way, it works for sure ;-)

Offline

#9 2009-07-09 05:41:17

sabooky
Member
Registered: 2006-11-02
Posts: 89

Re: can't open file syntax.vim

I had this problem, but the culprit was mercurial for me.

If you're getting the vim72 error check what's in that directory.
The only file in there for me was..

# ls /usr/share/vim/vim72/syntax/
HGAnnotate.vim
# pacman -Qo /usr/share/vim/vim72/syntax/HGAnnotate.vim 
/usr/share/vim/vim72/syntax/HGAnnotate.vim is owned by mercurial 1.3-1

I tested it first by moving vim72 to vim72.bak and the problem went away, after that I uninstalled mercurial (I never use it)

Here's the loading order according to the vim documentation:

You don't normally set $VIMRUNTIME yourself, but let Vim figure it out.  This
is the order used to find the value of $VIMRUNTIME:
1. If the environment variable $VIMRUNTIME is set, it is used.  You can use
   this when the runtime files are in an unusual location.
2. If "$VIM/vim{version}" exists, it is used.  {version} is the version
   number of Vim, without any '-' or '.'.  For example: "$VIM/vim54".  This is
   the normal value for $VIMRUNTIME.
3. If "$VIM/runtime" exists, it is used.
4. The value of $VIM is used.  This is for backwards compatibility with older
   versions.
5. When the 'helpfile' option is set and doesn't contain a '$', its value is
   used, with "doc/help.txt" removed from the end.

source: http://www.vim.org/htmldoc/starting.html#$VIMRUNTIME

It was loading #2 for me, removing vim72 directory means it loads #4. (skips #3 since I don't have a /usr/share/vim/runtime dir)

Offline

#10 2009-07-25 10:15:23

veox
Member
Registered: 2008-10-28
Posts: 48
Website

Re: can't open file syntax.vim

Considering sabooky's post, try reinstalling mercurial if you do need it.

Offline

#11 2009-07-25 18:11:59

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: can't open file syntax.vim

/usr/share/vim/vimcurrent/

It's more usable to use vim72 instead of vimcurrent, but the best way to use simply /usr/share/vim like I do in my vim-scripts.

Offline

#12 2010-07-10 21:33:49

trojkat
Member
From: Wrocław, Poland
Registered: 2008-03-03
Posts: 20
Website

Re: can't open file syntax.vim

Just reinstall vim.


pacnet <- (Gentoo Portage for ArchLinux)

Offline

Board footer

Powered by FluxBB