如何在VS2012中自动格式化代码缩进? [英] How to auto format code indentations in VS2012?

查看:1174
本文介绍了如何在VS2012中自动格式化代码缩进?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在VS2012中自动格式化代码以节省输入和删除空格和制表符的时间?



$如果您在输入文本时正在寻找格式化代码,那么在 Tools \ Options \ Text中有一些额外的设置编辑器区域。



由于您的示例似乎是一个配置文件(XML),请查看XML编辑器。 $ b


否则,要随时进行格式化,来自 @mitaka @Xaruth 的建议都是不错的选择。

要激活格式化文档格式选择的按键不同,具体取决于在Visual Studio中激活的开发设置。要查看哪些击键被分配给您的VS副本中的命令,请查看编辑菜单中的内容。
$ b


How to auto format code in VS2012 to save time typing and deleting spaces and tabs?

解决方案

If you are looking to format the code as you enter the text, there are some additional settings in Tools\Options\Text Editor area.

Since your example appears to be a config file (XML) look at the XML editor.

Otherwise, to format at any time, the suggestions from @mitaka and @Xaruth are good.

Be aware that the keystrokes to activate Format Document and Format Selection are different depending on what Development Settings you have active in Visual Studio. To see which keystrokes are assigned to the command in your copy of VS look in the Edit menu.

这篇关于如何在VS2012中自动格式化代码缩进?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆