LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Terminal highlight code c,c++,java...etc? (http://www.linuxquestions.org/questions/linux-software-2/terminal-highlight-code-c-c-java-etc-856556/)

michaelinux 01-15-2011 07:55 PM

Terminal highlight code c,c++,java...etc?
 
How do i get my terminal to highlight code when i'm writing some code, i remember it was already enabled in all the other distributions that i have used, i remember one time i had to edit some file to enable it and i had to get some code to make it highlight what programming language i was using, i can't really remember what file it was so if you can help me, i'd really appreciate it.
thanks.

MS3FGX 01-15-2011 08:07 PM

Surely you aren't writing code with Bash alone. What text editor are you using to program in?

MTK358 01-16-2011 08:36 AM

This has nothing at all to do with the terminal.

michaelinux 01-16-2011 10:16 AM

Quote:

Originally Posted by MS3FGX (Post 4225642)
Surely you aren't writing code with Bash alone. What text editor are you using to program in?

i've always used nano, i'm learning to use vim though, i only use IDEs when i have a really big project.
i hope you can help me, as i said before i have done this before but i just can't remember. :(

TheIndependentAquarius 01-16-2011 10:20 AM

Quote:

Originally Posted by michaelinux (Post 4225633)
How do i get my terminal to highlight code when i'm writing some code,

Can you give a dummy example of this for us to understand what you are saying? e.g what do you do when you get the terminal:
Code:

anisha@linux-dpjj:~>

MTK358 01-16-2011 10:20 AM

As far as I know, only the unstable version of nano supports syntax highlighting. Maybe they released it by now.

TheIndependentAquarius 01-16-2011 10:22 AM

Emacs running inside the terminal does support syntax highlighting, if that's what you mean.

brianL 01-16-2011 02:49 PM

If you look in /usr/doc for nano, you'll find a nanorc example, with the options for syntax highlighting right at the bottom. Copy that to your home directory as .nanorc, and edit it.

michaelinux 01-17-2011 11:40 AM

Quote:

Originally Posted by brianL (Post 4226458)
If you look in /usr/doc for nano, you'll find a nanorc example, with the options for syntax highlighting right at the bottom. Copy that to your home directory as .nanorc, and edit it.

ok i'll try that when i get home.
and for those that don't understand what i mean, what i'm trying to do is just like when in a IDE you get the programming language keywords highlighted in other color. that's what am trying to get.
anyway, i'll let you know if i get anything done.

TheIndependentAquarius 01-17-2011 11:42 AM

Ever heard of Emacs? It does what you want.

TheIndependentAquarius 01-17-2011 11:46 AM

Look up this: http://sunsite.ualberta.ca/Documenta...q_5.html#SEC75


All times are GMT -5. The time now is 06:24 PM.