LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-02-2005, 02:21 PM   #1
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Rep: Reputation: 15
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?
 
Old 01-03-2005, 06:04 AM   #2
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Original Poster
Rep: Reputation: 15
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?
 
Old 01-03-2005, 07:14 AM   #3
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
you can probable check for aliases for vim..cos vim by default has colors enabled in Ent2wk edition of redhat
 
Old 01-03-2005, 08:57 AM   #4
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Original Poster
Rep: Reputation: 15
vi is aliased to vim in RH. I can verify this by running "vi" and it will start with the vim screen.
 
Old 01-03-2005, 11:07 AM   #5
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
I'm not sure, but do you have the vim-enhanced package installed? Run:

Code:
rpm -qa | grep vim
and tell us what it outputs.
 
Old 01-03-2005, 01:23 PM   #6
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Original Poster
Rep: Reputation: 15
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
vim-common-6.2.98-1
vim-enhanced-6.2.98-1
vim-minimal-6.2.98-1
OK, I just tried ":color on" and I get:

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!

Last edited by R4z0r; 01-03-2005 at 01:32 PM.
 
Old 01-04-2005, 03:13 AM   #7
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
To find out more about color, do:
Code:
	:help color
Try doing the following:

Code:
	:cal SetSyn("perl")
If you want to change the colorscheme, do:

Code:
	:colorscheme <TAB>
The <TAB> will let you tab through the installed colorschemes.
 
Old 01-05-2005, 01:06 PM   #8
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Original Poster
Rep: Reputation: 15
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
 
Old 09-06-2011, 02:22 PM   #9
rmanola
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Cool

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:
  • rm -rf /bin/vim
  • cat "alias vim='/usr/bin/vim'" >> ~/.bashrc

Also make sure you have installed vim-enhanced.

Best regards.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim syntax highlighting problems. donniejones18 Linux - Software 7 04-16-2006 09:03 PM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 12:08 PM
Adding Syntax Highlighting to VIM TastyWheat Linux - Software 2 02-27-2004 04:37 AM
Java syntax highlighting in vim Phantomas Linux - Software 0 08-16-2003 05:34 AM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration