Color in VIM

Hello,

On every boxes I have when I use VIM there is some colors
But with one of my boxe (a new one) there is no color at all when I edit a file using VIM

Any idea ?

Pascal

I’ve tried to set in VIM
:syntax on

and
:set term=xterm

But I still don’t have color in vim,

Nobody has an idea ?

Thanks
Pascal

For syntax highlighting to work, you need to have syntax files installed. A default set is usually installed with vim. On an interworx box, syntax files are found here: /usr/share/vim/vim63/syntax

If those files aren’t there, or there isn’t a syntax file for the (programming) language you are using, then syntax highlighting won’t work. Also, vim uses the file extension to determine which syntax file to use, so if the file is a new unsaved file and/or doesn’t have a file extension, highlighting won’t work either.

Hope that helps.

Thanks Socheat

But the problem was not this one.

In fact when I did a which vi I saw that vim used /bin/vi

It was not an alias, as my others boxes
Also when I did in VIM something like
:scriptname or
echo $VIMRUNTIME

these 2 commands did show nothing

I have copied /usr/bin/vim from one of my box to the one it didn’t work, then I have created an alias vi=vim then deleted the /bin/vi file

Now everything is working

Very strange, as I have unistall the rpm then reinstall them with yum, but I think the vi in /bin was the pbm. Lol I’ve done a lot of thing to have vim with color, as set the $term to xterm, etc…

Thanks a ton for your help, even if I found myself :slight_smile:

Pascal

Historically, ‘vi’ and ‘vim’ are two different programs. ‘Vim’ has many, many more useful features as you’ve found out firsthand. :slight_smile: But, since ‘vi’ is very old and ‘vim’ is probably the most commonly used variant of ‘vi’, most systems alias ‘vi’ to ‘vim’, since it’s one less letter to type when running the program. :wink:

Well thanks for all these informations :slight_smile:

can’t figure out why I had a vi and no alias, but anyway, now it works :slight_smile:

My ISP did like to charge me for this, even if I think, it was a first install pbm, so I’m happy having found myself and see that you’d help me.

As usual a big thank you

Pascal