简体   繁体   中英

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?

Its really irritating Ctrl+E+D 'ing everytime you want to prettify your code.

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. Oh, and it rocks in so many other ways as well.

You can try this extension for Visual Studio 2013 I wrote recently. 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"

Format Document on Save

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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