syntax.vim file is missing
Asked Answered
P

2

5

I jumped on to a colleague's computer and tried opening a C++ file in vim, and got the following error -

E484: Can't open file /usr/local/share/vim/syntax/syntax.vim

Interestingly, the location /usr/local/share/vim/ does not even exist. It looks like vim is installed in /usr/share/vim

I tried hacking the ~/.vimrc, but I think the ~/.vimrc is fine, because I ssh'ed into another machine, and vim was able to do syntax highlighting there.

This is on debian 7. Also, interestingly, when I did env from tcsh, I did not see VIMRUNTIME listed there.

Any suggestions?

Perl answered 19/6, 2016 at 21:11 Comment(2)
make a symlink from this directory that's vim requesting to VIMRUNTIME directory: ln -s /usr/local/share/vim path/to/VIMRUNTIME/directory/Contraposition
Make sure you're running the vim that you think you are. which vim.Ruel
B
6

However,when it comes to me, I installed vim8.2 through homebrew. I checked this problem through the internet and find a post which says

brew link vim 

may help you fix this problem. (May not be useful when in your case ...)

Bartels answered 31/10, 2020 at 14:24 Comment(3)
this is the neat answer.Corunna
That helped me too with my homebrew installation of vim.Olivette
Thanks bro, it really fix my problem.Ipomoea
P
3

My case, did not detect /usr/share/vim/vim80/syntax/syntax.vim since I updated....

my solution:

corrects the path

ln -s /usr/share/vim/vim81 /usr/share/vim/vim80

corrects the access to colors/

ln -s /usr/share/vim/vim80/syntax/* .vim/colors/
Pusher answered 31/5, 2019 at 13:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.