Friday, March 14, 2008

vim71: Problem of "syntax highlighting" solved

I don't know how this problem started. I am using vim for quite sometime and everything was working fine - I was able to see syntax highlighting for my C code and searches were also highlighted. But, for past few weeks, I wasn't able to see colors! I was running vim70 and thought that the problem will go away after updating to vim71. But, still the problem persisted. After lot of trials and errors, I was able to correct it.

Inside vim session, when I did :syntax on, I was seeing the following error: Error detected while processing /home/ns158690/.vim/syntax/syntax.vim: line 42: E216: No such group or event: filetypedetect BufRead And I had this line in .bashrc: export VIM=/home/ns158690/.vim So, what is missing? Finally I got to know that, I have to have an environment variable called VIMRUNTIME and it should point to the place where the latest vim is installed. So, I added this line and the problem got solved: export VIMRUNTIME=/opt/csw/share/vim/vim71 I think, with every upgrade of vim, we will have to keep on changing this. So, instead of changing this everytime, we can use a link: ln -s /opt/csw/share/vim/vim71 /opt/csw/share/vim/vim_latest export VIMRUNTIME=/opt/csw/share/vim/vim_latest So, with every upgrade, just change the link and everything should work without much hassles.

No comments: