RdHat Vim Syntax Highlighting
Hi All,
I can't seem to enable syntax highlighting on my RedHat Enterprise Linux (CentOS) box. Usually, I'd just type :syntax on in vim but this doesn't seem to work on the version I have with RedHat. /usr/share/vim/vim62/syntax/syntax.vim Is present but it still won't work. I am ssh'ng in from a Windows box using PuTTY. I know color is working as I get colors with "ls". Any ideas? |
Anyone? Surely this can't be too tricky a request. AFAICS, I've followed exactly as it says in the man page so is this a known issue with RH?
|
you can probable check for aliases for vim..cos vim by default has colors enabled in Ent2wk edition of redhat
|
vi is aliased to vim in RH. I can verify this by running "vi" and it will start with the vim screen.
|
I'm not sure, but do you have the vim-enhanced package installed? Run:
Code:
rpm -qa | grep vim |
I didn't have vim-enhanced installed so I've just installed it.
Now, when I type "vim" I get some color (<Enter> is in blue on the title screen). As soon as I open some Perl up though, nothing is highlighted. I try typing ":syntax on" and it just accepts it (No error) but it won't highlight anythign" Code:
[root@mail perl]# rpm -qa | grep vim E185: Cannot find color scheme on I think syntax may be working as when I search for things it highlights them all but it just wont highlight my code. Any ideas about that error I get? Google shows nothing (In English) and I can't even find the word "color" in the man page for vim! |
To find out more about color, do:
Code:
:help color Code:
:cal SetSyn("perl") Code:
:colorscheme <TAB> |
Thanks for the advice but nothings worked with it. It just moans about command not found and the color command doesn't understand <TAB>.
I think RedHat have customised it quite a lot and I've given up trying to undo it all. I've just removed all the vim RPM's and compiled the lattest version from source - it's now working perfectly :) |
6 Years have passed and this same problem happens on centOS too.
It turns out that the vim command points to: /bin/vim If you do a ls -lah /bin/vim: lrwxrwxrwx 1 root root 7 Jun 15 2010 /bin/vim -> /bin/vi In other words, every time you type "vim", actually it uses vi! There are two ways of fixing this:
Also make sure you have installed vim-enhanced. Best regards. |
All times are GMT -5. The time now is 09:20 AM. |