Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
793 views
in Technique[技术] by (71.8m points)

visual studio - How do I turn off auto-formatting in VS2013 for C++?

VS2013 has added auto-formatting for C++. My personal opinion on auto-formatting is that it's ultimately harmful for developers but I have to accept not everyone agrees. What bugs me is that I can't seem to disable auto-formatting completely. I have unchecked every checkbox under Tools->Text Editor->C/C++->Formatting->General yet when I type:

void f ()

VS2013 replaces this with

void f()

That's not the code-standard in this specific project which means I have to go back and insert a space. There are other examples where I have to fight against VS.

I don't want to change the spacing settings because

  1. I work in multiple projects with different code standards
  2. I don't believe in auto-formatting so I just want it to get out of my way

I just want VS to not modify my code automatically.

PS. I am not against that VS can format code but I want to invoke that manually

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can turn off automatic C / C++ /C# code formatting by going to the Options dialog from the Tools menu, selecting the Text EditorC / C++ / C#FormattingGeneral page, and unchecking all the boxes there. You'll still be able to manually format when all of the auto-formatting settings are turned off.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...