LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   vim editor (https://www.linuxquestions.org/questions/linux-general-1/vim-editor-419657/)

shabbirhai 02-26-2006 02:40 AM

vim editor
 
Hello.
i was using redhat linux 8.0. in that when i was opening a new file with vi command (eg. vi hello.cpp). After opening the file i was writing the programs in c/c++/java.Text was formatting very good.
i mean when i use keywords like while,for,int,char,break.......etc
there was change in the color of text for that key words....
and also if open a for loop or a function it was going to the next tab of the new line .but it is not happening in fedora core 4.
please help me................

eg:
for()
{ (if i press enter here cursor was going to
new tab of next line in redhat 8 but it is
not going in FC 4.)
}

bigrigdriver 02-26-2006 03:23 AM

Edit the file /etc/vimrc. Look for this:
" enable syntax highlighting
syntax on

If it isn't in the file, add it to turn on syntax highlighting.

mijohnst 03-01-2006 04:54 PM

Hum...mine is without color also and when I looked into the /etc/vimrc file it did have "syntax on" listed. Is there somewhere else maybe that you can turn it on?

cramer 03-01-2006 05:06 PM

For me sometimes at first it doesn't do highlighting for the synatax, but if you quit and reopen the file it will then work.

cs-cam 03-02-2006 01:29 AM

It's also possible the terminal emulator you're using doesn't support ANSI colours.

jomen 03-02-2006 02:01 AM

Quote:

Is there somewhere else maybe that you can turn it on?
/etc/vimrc.local is a global file
~/.vimrc is your personal file which each override what is in /etc/vimrc

syntax on
If it is not in there - put it in.


All times are GMT -5. The time now is 05:45 PM.