开发者

How to have colors in vim when :syntax on does nothing?

开发者 https://www.devze.com 2023-01-21 03:54 出处:网络
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 ...

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.


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


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.


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


If you've already installed vim-enhanced, then check your PATH. Chances are good that /usr/bin isn't there.

The vi in /bin is the limited-feature "tiny" version of vim. If you look in /usr/bin, you'll find the "huge" version (as vim, not vi).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号