Author Topic: About curly brace auto-completion  (Read 7032 times)

Offline hovey

  • Single posting newcomer
  • *
  • Posts: 3
About curly brace auto-completion
« on: June 17, 2010, 04:08:10 pm »
There is currently a feature about curly brace auto-completion.
When I enter a { on a single line, it will automatically add an empty line and a } on the thrid line.
This feature is great. But why not extend it a little more?
For java style, the { is in the end of a line. When I enter { in the end of line, the close brace } is automatically added. Why not test if a Enter follows, it will add a new empty line between { and }, and point the caret to that line.

Currently, if I don't close the brace-completion, it will takes me many extra keys to write the codes in java style.
« Last Edit: June 17, 2010, 04:09:53 pm by hovey »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2777
Re: About curly brace auto-completion
« Reply #1 on: June 18, 2010, 01:13:13 pm »
If you'd like to roll-your-own (language independent) syntax in CodeBlocks, you might fine cbKeyMacs useful.

It allows you to define any sequence of keys, then paste them in via hotkey or mouse.

http://code.google.com/p/cbkeymacs/w/list

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: About curly brace auto-completion
« Reply #2 on: June 18, 2010, 04:03:29 pm »
You can also try to use abbreviations  ("Settings -> Editor... -> Abbreviations").

Offline hovey

  • Single posting newcomer
  • *
  • Posts: 3
Re: About curly brace auto-completion
« Reply #3 on: June 18, 2010, 07:01:09 pm »
If you'd like to roll-your-own (language independent) syntax in CodeBlocks, you might fine cbKeyMacs useful.

It allows you to define any sequence of keys, then paste them in via hotkey or mouse.

http://code.google.com/p/cbkeymacs/w/list


Thx. This tool is great. But if it can invoke the macro by context or a regular expression rule, it may be more helpful.

Offline hovey

  • Single posting newcomer
  • *
  • Posts: 3
Re: About curly brace auto-completion
« Reply #4 on: June 18, 2010, 07:03:47 pm »
You can also try to use abbreviations  ("Settings -> Editor... -> Abbreviations").

Yeah. But it requires much extra keys to do my jobs. My main concern is to reduce redundant keys.

dj3500

  • Guest
Re: About curly brace auto-completion
« Reply #5 on: May 28, 2012, 03:14:57 pm »
Hi,
Just wanted to say that I'd also appreciate this feature. I think it's the default behaviour in Eclipse and NetBeans, and it works really well.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: About curly brace auto-completion
« Reply #6 on: May 28, 2012, 04:36:33 pm »
For java style, the { is in the end of a line. When I enter { in the end of line, the close brace } is automatically added. Why not test if a Enter follows, it will add a new empty line between { and }, and point the caret to that line.
I think this is already default behavior (at least in nightly builds).

Offline xorgx3

  • Single posting newcomer
  • *
  • Posts: 2
Re: About curly brace auto-completion
« Reply #7 on: November 06, 2013, 05:42:33 pm »
Sorry for bump, but i can't extort my codeblocks to use braces like in Java... Anyone knows why?