News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Change comment style

Started by mgoyanes, February 23, 2012, 12:02:58 PM

Previous topic - Next topic

mgoyanes

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

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

mgoyanes

Sorry but where can I download that plugin?

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

mgoyanes

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

oBFusCATed

Reinstall and enable the contrib plugins...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

mgoyanes

Quote from: 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.

Sweet. Many thanks

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

stream comment:
/*

  int a;

*/

rihardmarius

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