views:

55

answers:

3

Hello,

Logged as root on a CentOS 5.3, I can't have colors in vim (7.0.237, minimal, common and enhanced rpms), even with :syntax on ... I can display colors with other commands, so I have colors (I don't know how many !)

Any clue ?

Thanks.

A: 

You might not have a syntax definition file for the type of file you are editing. What kind of file is it? Try forcing a particular syntax format with

:set syntax=<format>

So, if you're editing XML, try

:set syntax=xml
Daniel DiPaolo
It is bash. I tried `:set syntax=sh` and `:set syntax=bash`, and I get nothing : no error, no message.
Erwan
Maybe I have no syntax scripts at all ?
Erwan
+1  A: 

How do you start Vim, with vim or with vi.

If started with vi win often uses a safe mode that disables many features to make it safe for administrative use.

If so, try vim instead.

David Mårtensson
Some distros map `vi` to `vim -C` to provide the vi compability. As original vi didn't have the bells and whistles, it feels rather limited after some Vim usage.
progo
I use `vim`. On my ubuntu machines, it works.
Erwan
A: 

CentOS comes with a "tiny" version of Vim installed which has limited features.

You'll have to install the "enhanced" package if you want all of the good stuff.

yum install vim-enhanced

At least that was what I had to do with CentOS 5.

To list all of the Vim packages:

 yum list vim*

There should be an enhanced version there (hopefully).

Curt Nelson
I already got it :
Erwan
vim-common.x86_64 2:7.0.109-4.el5_2.4z installedvim-enhanced.x86_64 2:7.0.109-4.el5_2.4z installedvim-minimal.x86_64 2:7.0.109-6.el5 installedAvailable Packagesvim-X11.x86_64 2:7.0.109-4.el5_2.4z CENTOS
Erwan
vim-common.x86_64 2:7.0.109-4.el5_2.4z installedvim-enhanced.x86_64 2:7.0.109-4.el5_2.4z installedvim-minimal.x86_64 2:7.0.109-6.el5 installedAvailable Packagesvim-X11.x86_64 2:7.0.109-4.el5_2.4z CENTOS
Erwan
SHould have a "preview" button for responses ! Sorry for formatting !
Erwan
@Erwan: I missed that in your original post. Your comment that `:version` reports "Tiny version" shows that the enhanced version is not getting ran; it should be reporting "Huge version". On my box, `vi` runs the tiny version while `vim` runs the enhanced version.
Curt Nelson
Ha ha hals -l `which vim`lrwxrwxrwx 1 root root 7 Aug 18 10:44 /bin/vim -> /bin/viI'll find the guilty, I promise ! :-)I have opened the vim-enhanced rpm and it puts executable in /usr/bin/vim, and this executable is OK.Thank you guys !
Erwan