Working with Visual Studio

There are a few settings I like to set up immediately whenever I am working with a clean install of Visual Studio to help my development go a little smoother. Here are just a couple of those things.

How to Enable Line Numbers. In Visual Studio line numbering is turned off by default. You have the ability to turn on line numbers for each type of file that you may work with, but I like to just enable line numbers for all languages.

Go to Tools > Options to open the options dialog.

Expand Text Editor and select All Languages

On the right side of the options dialog you will see a checkbox labeled Line Numbers.

This checkbox is filled by default, indicating that some but not all of the file types have line numbers enabled. Click the checkbox twice (once to uncheck it, and again to check it). Now line numbers are enabled for all files.

Matching Open and Close braces. When debugging any code that deals with open and closing braces (such as C# or XML) it can be difficult to determine which matching brace is missing. Visual Studio gives you the ability to choose foreground and background colors for matching braces.

Click Tools > Options to open the options dialog.

Expand the Environment tab and select Fonts and Colors.

On the right side of the dialog you will see a Display Items section. near the top of the list you will find two items called Brace Matching (Highlight)  and Brace Matching (Rectangle). Highlight allows you to select a foreground color and Rectangle allows you to select the backgound color.

Select Brace Matching (Rectangle)  as noted in the image below.

On the Item Background combobox you can now select a color that will stand out so that you can easily see matching braces. (I like Lime – it is very conspicuous).

Once you click OK all your matching braces will be highlighted when your cursor is adjacent to the matching brace.

For Example…

for(int i = 0; i < 10; i++)
{

//do somework here
}
|


Categories: Misc

Tags:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Gregor Dzierzon

Subscribe now to keep reading and get access to the full archive.

Continue reading