Formatting, C/C++, Text Editor, Options Dialog Box

Lets you change the default behavior of the Code Editor when you are programming in C or C++.

To access this page, in the Options dialog box, in the left pane, expand Text Editor, expand C/C++, and then click Formatting.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Working with Settings.

You can configure how braces are aligned when you press ENTER after you begin a code block, for example, a function or a for loop. The braces can either be aligned with the first character of the code block or indented.

Automatic Indentation On Tab

You can configure what happens on the current code line when you press TAB. Either the line is indented or a tab is inserted.

The editor can scan open source files for preset words in the comments. It creates an entry in the Task List window for any keywords that it finds. For more information about the Task List window see Task List (Visual Studio).

Highlight Matching Tokens

When the cursor is next to a brace, the editor can highlight the matching brace so that you can more easily see the contained code.

When you bring a file into the text editor, you can enable the outlining feature. For more information, see How to: Outline and Hide Code. When this option is selected, the outlining feature is enabled when you open a file.

Automatic outlining of #pragma region blocks

When this option is selected, automatic outlining for pragma directives is enabled. This lets you expand or collapse pragma region blocks in outlining mode.

Automatic outlining of statement blocks

When this option is selected, automatic outlining is enabled for the following statement constructs: