如何在 VS2013 for C++ 中关闭自动格式化?
VS2013 为 C++ 添加了自动格式化.我个人对自动格式化的看法是它最终对开发人员有害,但我必须接受并非所有人都同意.我的问题是我似乎无法完全禁用自动格式化.当我输入时,我已经取消选中 Tools->Text Editor->C/C++->Formatting->General 下的每个复选框:
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 将其替换为
VS2013 replaces this with
void f()
这不是这个特定项目中的代码标准,这意味着我必须返回并插入一个空格.还有其他一些例子,我必须与 VS 作斗争.
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
- 我在多个具有不同代码标准的项目中工作
- 我不相信自动格式化,所以我只是想让它不受我的影响
我只是想让 VS 不自动修改我的代码.
I just want VS to not modify my code automatically.
附注.我不反对 VS 可以格式化代码,但我想手动调用它
PS. I am not against that VS can format code but I want to invoke that manually
推荐答案
您可以通过从 工具 转到选项 对话框来关闭自动 C/C++/C# 代码格式设置strong> 菜单,选择 Text Editor → C/C++/C# → Formatting → General 页面,并取消选中那里的所有框.关闭所有自动格式化设置后,您仍然可以手动格式化.
You can turn off automatic C / C++ /C# code formatting by going to the Options dialog from the Tools menu, selecting the Text Editor → C / C++ / C# → Formatting → General 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.
相关文章