Brackets!
已回答
So before we start I just want to say how much I love CLion. I've tried many IDEs before like Visual Studio, Code::Blocks etc. but CLion it the only one that fitted my needs and desires. Now back to the problem.
for (int i; i>0; i++){}
So basically I want CLion to move the brackets to a new line without me pressing <enter>. So when I'm finished typing in "for" and I close it with a bracket ")" I don't want to press enter to go to a new line and then insert a bracket. I want to only insert a bracket and I want it in a new line automatically.
for (int i; i>0; i++)
{}
and yes I did select go to new a line in settings > code style > wrapping and braces > braces placement > other / in functions
请先登录再写评论。
Hi!
The code style options, customized in the File | Settings | Editor | Code Style | C/C++ tab, are applied by CLion on reformatting the source code. So in order to apply these options you need to, for example, choose Code | Reformat Code on the main menu.
Also you can use Live Templates (File | Settings | Editor | Live Templates). For example, you can change the existing "for" template so that the first brace is on a new line:
In this case in your source code after typing for you will need to press Tab (it's a default value for Expand with, you can change it) and the template will be applied.
Please note that you can add your own template if you need. More information about Live Templates can be found in the web-help.