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?

Gumbly jr.
  • 729
  • 2
  • 9
  • 18
  • make a symlink from this directory that's vim requesting to VIMRUNTIME directory: `ln -s /usr/local/share/vim path/to/VIMRUNTIME/directory/` – dNitro Jun 19 '16 at 22:03
  • 1
    Make sure you're running the vim that you think you are. `which vim`. – Randy Morris Jun 20 '16 at 16:18

2 Answers2

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 ...)

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/
Ferreirain
  • 66
  • 4