Vim cannot find syntax.vim

The problem is the make command.

make VIMRUNTIMEDIR=/usr/share/vim/vim74

From the question, syntax.vim is actually located in /usr/local/share/vim/vim74 so you should instead be using the following.

make VIMRUNTIMEDIR=/usr/local/share/vim/vim74

In general, the VIMRUNTIMEDIR variable used by make should be consistent with the prefix variable used by the configure script.


In bash run:

export VIMRUNTIME=/usr/share/vim/vim73

Then in vim run:

:syntax on

(In my case vim was looking in /usr/share/vim/vim74, whereas there was no /usr/local/share/.... I was on an AWS EC2 Ubuntu.)

Also, it needed to be VIMRUNTIME, not VIMRUNTIMEDIR.

Note that for permanence you can place the above export line into your shell's personal initialization file, e.g. ~/.bash_profile.


Can you just make a symlink to where vim thinks it should be? i.e.

sudo ln -s /usr/local/share/vim/vim74/syntax/syntax.vim /usr/share/vim/vim74/syntax/syntax.vim

(If this target directory doesn't exist, then link the higher-level directory instead.)