News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

autom. matching braces

Started by whitesuit, July 12, 2006, 01:21:36 AM

Previous topic - Next topic

whitesuit

Hi, I normally use VIM to create my C source files, i was thinking on switching to CodeBlocks, however, I have in VIM a "feature" to automatically complete matching braces for example: if i write:

int foo() {

it will automatically complete for me:

int foo() {

}

is there something similar in CodeBlocks?

Thanks,

Ceniza

Auto-complete is the most similar thing.

Go to Settings->Editor. Find "Abbreviations" and add a new one, like mb (or any other name) and in code add this (use tabs or spaces, whatever you prefer):

Code (cpp) Select
{
  |
}


Click OK, create a new file or just open an existing one and type this:

Code (cpp) Select
int foo()mb

Now press Ctrl+J :)

whitesuit

cool, thanks, but in the future if it's possible it would be nice for it to autocomplete the closing brace for me, like in eclipse, netbeans, etc. Because it's more work to write mb and press cntrl+j then just typing the opening brace and already get the closing one, leaving the cursor on the indented position to start writing code.