Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: pomelo on August 30, 2011, 10:51:46 am

Title: syntax highlighting in C/C++
Post by: pomelo on August 30, 2011, 10:51:46 am
hi,

I want to know if there is any way to set special colors to functions, macro definitions, and typedefed types in C/C++.

thanks in advance.
Title: Re: syntax highlighting in C/C++
Post by: MortenMacFly on August 31, 2011, 08:43:06 am
I want to know if there is any way to set special colors to functions, macro definitions, and typedefed types in C/C++.
Inspect the lexer settings for the language of your choice in the editor options.
Title: Re: syntax highlighting in C/C++
Post by: pomelo on August 31, 2011, 09:38:09 am
Inspect the lexer settings for the language of your choice in the editor options.
In Syntax Highlighting settings' panel there is a predefined highlighting mode for C/C++, but the predefined mode does not handle colors for functions, macro definitions... and I failed to find the way to add them to the predefined list. What is more, I did add a new color theme, with different name besides default, but it seems still impossible to modify predefined lexer settings.
Any detailed instructions? Thanks a lot.
Title: Re: syntax highlighting in C/C++
Post by: oBFusCATed on August 31, 2011, 09:58:04 am
What you want is semantic highlighting (hope the term is correct), which C::B doesn't support.

Something like this: http://zwabel.wordpress.com/2009/01/08/c-ide-evolution-from-syntax-highlighting-to-semantic-highlighting/
Title: Re: syntax highlighting in C/C++
Post by: pomelo on September 01, 2011, 11:50:56 am
Thanks oBFusCATed! So there is no way to use semantic highlighting in CB?
Title: Re: syntax highlighting in C/C++
Post by: oBFusCATed on September 01, 2011, 12:34:15 pm
There is one way, you can implement it yourself :)
Title: Re: syntax highlighting in C/C++
Post by: axmz on October 12, 2011, 04:24:47 pm
hi
I've just installed code::blocks and wanted to write the source code in c language but when I started to type the code I instantly realized that the syntax highlighting wasn't working. I checked the the syntax highlighting menu in the editor settings and there are no predefined modes of any kind. have I missed to install some plug-in or why isn't it working?
Title: Re: syntax highlighting in C/C++
Post by: Freem on October 12, 2011, 04:31:10 pm
What is your OS?
Which version of C::B are you using?
How did you install it? (compilation of sources, installation from official installer?)
Title: Re: syntax highlighting in C/C++
Post by: stahta01 on October 12, 2011, 04:57:00 pm
@axmz:

What is the file extension; I believe Code::Blocks uses the file extension to determine Language.

Tim S.
Title: Re: syntax highlighting in C/C++
Post by: axmz on October 14, 2011, 11:57:35 am
OS: WinXP
C::B version: 10.05
I installed the official version I downloaded from this official site but I've kinda rushed the installation, so it's possible that I unintentionally overlooked some settings along the way...
File extension is *.c source file (if that's what your question regarded to)