简体   繁体   English

在Visual Studio中自动设置文档格式?

[英]Automatically Format Document in Visual Studio?

Anyway of invoking the Edit > Advanced > Format Document" VS command automatically when switching away from a document / routinely with a timer / on entering a document? 在从文档切换为常规文档/使用计时器常规操作/在输入文档时自动调用“ 编辑>高级>设置文档格式” VS命令吗?

Its really irritating Ctrl+E+D 'ing everytime you want to prettify your code. 每当您想美化代码时,它的确令人讨厌Ctrl + E + D。

ReSharper does this every time you close a brace, press semicolon or paste some code in. It's not quite what you're asking for, but I don't think you'll notice the difference. 每次关闭括号,按分号或粘贴一些代码时,ReSharper都会执行此操作。这并不是您所要的,但我认为您不会注意到其中的区别。 Oh, and it rocks in so many other ways as well. 哦,它也以许多其他方式摇摆。

You can try this extension for Visual Studio 2013 I wrote recently. 您可以为我最近编写的Visual Studio 2013尝试此扩展。 This is almost the same as the feature in Productivity power tools but also works for *.cshtml, *.xml and all formats which support the command "Format Document" 这几乎与Productivity电动工具中的功能相同,但也适用于* .cshtml,*。xml和所有支持命令“格式文档”的格式

Format Document on Save 保存时格式化文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM