Author Topic: autom. matching braces  (Read 3611 times)

whitesuit

  • Guest
autom. matching braces
« on: July 12, 2006, 01:21:36 am »
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,

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: autom. matching braces
« Reply #1 on: July 12, 2006, 02:16:34 am »
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
 {
  |
}

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

Code: cpp
int foo()mb

Now press Ctrl+J :)

whitesuit

  • Guest
Re: autom. matching braces
« Reply #2 on: July 12, 2006, 07:11:36 am »
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.