如何在VS2012中自动格式化代码缩进? [英] How to auto format code indentations in 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屋!