I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
Right click:
Works in VS 2015, maybe earlier version.
In VS 2017 Format Document is CTRL E + D.
But...if you want to add the Format Document button to a tool bar do this.
Right click on tool bar.
Select "Customize.."
Select the "Commands" Tab.
Select the "Toolbar" radio button.
Select "Text Editor" from the pull down next to the radio button (or what ever tool bar you want the botton on)
Now...
Click the Add Command button.
Categories: Edit
Commands: Document Format
Click OK
I have installed an extension named "Format document on Save" which formats the whole document every time you save it. For install it in VS15 or 17, on Tools just click the "Extensions and Updates...":
And then just go to "Online" at the left panel and search for "Format document on save"
I hope it helps!.
If you display the HTML Source Editing toolbar there is a "Format the Whole Document" button as well
To format a selection: Ctrl+K, Ctrl+F
To format a document: Ctrl+K, Ctrl+D
See the pre-defined keyboard shortcuts. (These two are
Edit.FormatSelection
andEdit.FormatDocument
.)