The best solution I got now is two macros
Add braces:
caret-end-line caret-begin-line "{" insert-break
Remove curly braces:
caret-up caret-end-line remove-word-next selection-match-brace cut-to-clipboard remove-line remove-word-previous insert-break paste-from-clipboard caret-up caret-end-line
The cursor position should be in the line of code that I want to add / remove curly braces.
source share