Formatting Code In Visual Studio For Increased Readability

Formatting Code in Visual Studio For Increased Readable Banner Image

Introduction

Visual Studio is featured packed and learning how to use it correctly can increase productivity. Formating the text in the text editor can be a quick way for prettier code and making it easy to read. Short cut key are best for this and you should learn as many as you can. But formating keyboard short cuts defaults have changed over the different versions of visual studio. So you either need to learn each of those or learn to change the defaults to your preference.

Default Format Document

These are the different default format document found in Visual Studio.

Visual Studio 2022 Format Document Hotkey
Visual Studio Format Document

To format the document means that the current tab open in the text editor will be formatted. So if you currenly have a cs file open then this command will make all the code in the that file formatted.

Edit -> Advanced -> Format Document

Hotkey

Control + K, Control + D

This means that you hold down control then press K and D.

How To Set up Visual Studio For Windows

Get Latest Updates