Does anyone know how to configure the clang so it does NOT autoclose my brackets and comments? Its super annoying.
Ideally I would like to autoclose only the `{ }` brackets in the way the old Eclipse editor did it: type `{`, press ENTER and the closing bracket is added with corect indentation.
None of it works now. VSCode somehow seems to at least keep the indentation a bit better, Eclipse is a mess right now.
Disable autoclose brackets and comments (clang)
-
kondalkolipaka
- Espressif staff

- Posts: 269
- Joined: Wed Jul 17, 2019 5:26 pm
Re: Disable autoclose brackets and comments (clang)
Hello,
You can customize this in the Language Configuration preferences.
You can customize this in the Language Configuration preferences.
Re: Disable autoclose brackets and comments (clang)
@kondalkolipaka There it is, thank you very much!
I also see there are some indentation rules which could possibly do what I want, just no Idea how to edit those. Ideally regardless of the language used.
I also see there are some indentation rules which could possibly do what I want, just no Idea how to edit those. Ideally regardless of the language used.
-
kondalkolipaka
- Espressif staff

- Posts: 269
- Joined: Wed Jul 17, 2019 5:26 pm
Re: Disable autoclose brackets and comments (clang)
To customize the indentation rules or add new ones, download the language configuration from here:
https://github.com/eclipse-tm4e/tm4e/bl ... ation.json
Modify it as needed.
Then, use the Add… button from the Language Configuration Preferences window.
https://github.com/eclipse-tm4e/tm4e/bl ... ation.json
Modify it as needed.
Then, use the Add… button from the Language Configuration Preferences window.
Re: Disable autoclose brackets and comments (clang)
Ok I just can't get the Textmate to indent at all. Tried adding some example indent rules, tried creating new workspace with example project, but when I press enter the cusror just goes to beginning of the line, no indentation, pretty much regardless of the settings. This should not be this hard.
Edit: Ok, a tiny improvement showing that something might be happening: first add DisableFormat: true to .clang-format. Then I have to add my custom rules as "C Source File", cant replace the original "C" rules. In this case there is some indentation happening, but only on each 2nd ENTER press. Results in one line not indented and one indented, alternating all the time.
I have added example rules from here: https://macromates.com/manual/en/appendix, specifically these:
Edit: Ok, a tiny improvement showing that something might be happening: first add DisableFormat: true to .clang-format. Then I have to add my custom rules as "C Source File", cant replace the original "C" rules. In this case there is some indentation happening, but only on each 2nd ENTER press. Results in one line not indented and one indented, alternating all the time.
I have added example rules from here: https://macromates.com/manual/en/appendix, specifically these:
Code: Select all
"indentNextLinePattern": {
"pattern": "^(?!.*;\\s*//).*[^\\s;{}]\\s*$"
},
"unIndentedLinePattern": {
"pattern": "^\\s*((/\\*|\\*/\\s*$|//|#|@interface|@implementation|@end).*)?$"
}
Who is online
Users browsing this forum: No registered users and 0 guests