LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2005, 03:43 AM   #1
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Rep: Reputation: 15
vi editor


hi,

i am having RH9 and the problem is that is cannot highlight the syntax in my vi editor. i have tried copying the .vimrc in my home dir. and also tried giving :syntax enable, but none of them help. $TERM is set to linux in text console and my terminal is able to display colors fine as i having Xwindow installed. Also, another computer with same RH9 works fine.

Please help...
 
Old 02-07-2005, 04:01 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
"vi" won't work with syntax highlighting as far as I'm concerned. "Vim" (Vi Improved) will. It's also "Esc: syntax on" to get the highlighting thing
 
Old 02-07-2005, 05:13 AM   #3
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Usually vi is linked to vim in a lot of distros already... Tis on my MDK anyway...
 
Old 02-07-2005, 08:14 AM   #4
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Original Poster
Rep: Reputation: 15
First, thank you Megaman X and amosf for trying to help me...

as amosf has said vi is linked to vim, it is true for RH9 also. I have tried both "syntax on" and "syntax enable" (as mentioned in vi help usr_06.txt) but none of them worked..

--------------------
usr_06.txt

*06.1* Switching it on

It all starts with one simple command: >

:syntax enable

That should work in most situations to get color in your files. Vim will
automagically detect the type of file and load the right syntax highlighting.
Suddenly comments are blue, keywords brown and strings red. This makes it
easy to overview the file. After a while you will find that black&white text
slows you down!

If you always want to use syntax highlighting, put the "syntax enable" command
in your |vimrc| file.

If you want syntax highlighting only when the terminal supports colors, you
can put this in your |vimrc| file: >

if &t_Co > 1
syntax enable
endif

If you want syntax highlighting only in the GUI version, put the ":syntax
enable" command in your |gvimrc| file.
----------------------------------------------------------------------
 
Old 02-07-2005, 03:42 PM   #5
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
The highlightling works great here... I'll try and figure out how and why it works
 
Old 02-07-2005, 06:20 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Well, I've got RH FC3 (supercedes RH9) and vimrc (note no '.') is in /etc:
-rw-r--r-- 1 root root 1437 Oct 20 06:49 /etc/vimrc
 
Old 02-08-2005, 11:45 PM   #7
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Original Poster
Rep: Reputation: 15
Hello everyone,

i think i need to reinstall vi editor...i have searched web also, but didn't find any solution....any more ideas????
 
Old 02-15-2005, 04:17 AM   #8
mschutte
Member
 
Registered: Jan 2005
Location: Innsbruck, Austria
Distribution: Debian GNU/Linux Lenny
Posts: 68

Rep: Reputation: 15
Have you ":set filetype"?
 
Old 06-28-2005, 11:28 AM   #9
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Original Poster
Rep: Reputation: 15
Hi frnds,

i think i got i got it resolved, as now i can see colors...... . i intalled vim-enhanced rpm and removed vim-minimal and it resolved the problem.............................
 
  


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
best editor Kaninchen Linux - Software 14 07-27-2004 07:52 PM
Vi editor tmurray Linux - General 5 03-12-2004 11:33 PM
Looking for C editor Uchiha sasuke Programming 5 11-21-2003 09:51 AM
Vi Editor BittaBrotha Linux - Software 1 02-09-2003 01:35 PM
Which editor? keymoo Linux - Newbie 26 11-11-2002 12:46 AM


All times are GMT -5. The time now is 02:43 AM.

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