Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, Can some one help me in changing the colour of the text in the terminal. I am programming in C and C++ . So if the text has different ...
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    2

    Changing Text Colour In Terminal

    Hi,
    Can some one help me in changing the colour of the text in the terminal.
    I am programming in C and C++ . So if the text has different colours then, its eaiser to debug errors as the colour changes.i want the colours to be different for the keywords,printf n scanf statements n so on.

    _____________________________________

    I am using Fedora 6 ,1GB RAM , 120GB HD,Dual operating System i.e WIN XP n Fedora 6 and Red Hat Enterprise Linux

  2. #2
    Just Joined!
    Join Date
    Sep 2007
    Posts
    15
    hi there,

    I don't code in C or C++ myself but I do do some programing in Java and I think I know what your problem is. If by terminal you mean some kind of text editor then you just need to find the right text editor for you. For my Java programing I use a program called Kate which colour codes all of my code which makes it easier to read. If this is your problem then you just need to shop around for the right text editor. As I said, I don't code in C or C++ myself so I may be way off the mark on this one but I hope this helps.

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Posts
    2
    Hi,
    While programming in C/C++ we have to open a file in vi editor . I want the colour of the text in this file(.c file) to change. As it is eaiser to program. How do I know the which editor I am using ? And how do I change text colour or my editor?

  4. #4
    Just Joined!
    Join Date
    Sep 2007
    Posts
    15
    hi again,

    vi is your editor. I did a little searching online and vi doesn't seem to come with a colour changing capability, instead they released a slightly different program called vim, which seems to be the same program with colour coding capabilities. The download is free from welcome home : vim online and you should be able to open all of you c/c++ files in it. I hope this program has everything your looking for, but if its not shopping around should be affordable now that your on Linux.

  5. #5
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    161
    to enable syntax highlighting in vim you type
    Code:
    :syntax on
    it's likely that you are already using vim although you typed "vi" to
    start the editor: the linux distros i've used (SuSE and Debian) just
    start vim when you call for vi.

    to make syntax highlighting your default, you add this command
    to your .vimrc file (in your home directory). without the colon ":"
    though.

    once syntax highlighting is enabled you can change the color scheme:
    Code:
    :colorscheme name
    vim ships with colorschemes a bunch of default colorschemes including
    koehler, elflord, torte, and zellner. there are many more at vim

    you might want to use gvim which starts vim in a GUI window. this will
    give you a menu to select colorschemes from, plus GUI colors are
    prettier than console colors.

    kai

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...