1

I installed CLion a day ago and I want to format the code automatically after I type semicolon like in Visual Studio (I am coding in C++). I tried the code style menu but it works only if I format it manually wit Ctrl + Alt + L.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
daristylee
  • 11
  • 3
  • [This answer](https://stackoverflow.com/a/53700870/5288316) might achieve what you're looking for, although you'll be using `clang-format` and not the built-in auto formatter. I'm also not sure how practical it is. – Nicolas Jun 03 '22 at 23:12
  • Hello Nicolas! Thanks for your comment, it helped me a lot, but it still format only when i run it and i want to format every time i write a new line of code. Have you any idea how can i do it? – daristylee Jun 04 '22 at 19:06
  • I think file watchers are only triggered when you save the file. Maybe you could change the auto save delay to 1 second in the system settings? I'm aware it's not exactly the solution you needed. – Nicolas Jun 04 '22 at 19:49
  • If the file will be saved at 1second than wont it be laggy? – daristylee Jun 05 '22 at 07:37

0 Answers0