Code::Blocks Forums

User forums => Help => Topic started by: mgoyanes on February 23, 2012, 12:02:58 pm

Title: Change comment style
Post by: mgoyanes on February 23, 2012, 12:02:58 pm
Hi there.

I'm using code::blocks to program in C language.

Is it possible to change the default coment style (//) to the C style (/**/)?
If I press CTRL+SHIFT+C code is commented with // and it gives error when compiling.
I know I can enter /**/ by hand but I was thinking if there was the possibility to create a key combination.

Regards,

mgoyanes
Title: Re: Change comment style
Post by: oBFusCATed on February 23, 2012, 12:42:16 pm
You can use the keybinder plugin to define shortcuts for edit->box comment or edit->stream comment.
I'm not really sure what is the difference between the two.
Title: Re: Change comment style
Post by: mgoyanes on February 24, 2012, 10:36:33 am
Sorry but where can I download that plugin?
Title: Re: Change comment style
Post by: oBFusCATed on February 24, 2012, 10:41:51 am
Hm, my magic ball seems to be broken at the moment and I cannot tell your os/distro/c::b version, so I can't tell you how to install it.

p.s. search for it and you'll find how to install it.
Title: Re: Change comment style
Post by: mgoyanes on February 24, 2012, 11:28:51 am
Sorry but did'n know that was needed to know that.

Code::Blocks  10.05 running on a windows 7 64bits machine.

I tryed to google it but I was unable to find. Probably putting the wrong keywords
Title: Re: Change comment style
Post by: oBFusCATed on February 24, 2012, 11:39:38 am
Reinstall and enable the contrib plugins...
Title: Re: Change comment style
Post by: mgoyanes on February 26, 2012, 02:12:34 pm
You can use the keybinder plugin to define shortcuts for edit->box comment or edit->stream comment.
I'm not really sure what is the difference between the two.

Sweet. Many thanks

box comment:
/*
*
* int a;
*
*/

stream comment:
/*

  int a;

*/
Title: Re: Change comment style
Post by: rihardmarius on August 18, 2016, 09:12:47 pm
One way is to go to Edit > Box-comment, but it doesn't have a shortcut by default.
To change this go to Settings > Editor > Keyboard shortcuts,
expand Edit > Box-comment and assign ctrl-shift-c to the Box-comment command, it will override the Comment command.

Cheers