I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting.
Visual-studio – How to auto format code in Visual Studio
indentationvisual-studio
Related Question
- Visual-studio – Open two instances of a file in a single Visual Studio session
- Visual-studio – How to count the lines of code in a Visual Studio solution
- Git – .gitignore for Visual Studio Projects and Solutions
- Turning off auto indent when pasting text into vim
- Visual-studio – Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio
- Visual-studio – Can you force Visual Studio to always run as an Administrator in Windows 8
- Visual-studio – Error message “No exports were found that match the constraint contract name”
Best Solution
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
.)Note for macOS
On macOS, use the CMD ⌘ key instead of Ctrl: