You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/writing-code-in-the-code-and-text-editor.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Explore code editor features
3
3
description: Learn about the features that the code editor in Visual Studio provides to make it easier for you to write and manage your code and text.
4
-
ms.date: 02/05/2025
4
+
ms.date: 05/07/2026
5
5
ms.topic: concept-article
6
6
helpviewer_keywords:
7
7
- code, editing [Visual Studio]
@@ -26,11 +26,11 @@ The different Visual Studio languages offer different sets of features, and in s
26
26
27
27
|Feature|Description|
28
28
|-|-|
29
-
|Syntax Coloring|Some syntax elements of code and markup files are colored differently to distinguish them. For example, keywords (such as `using` in C# and `Imports` in Visual Basic) are one color, but types (such as `Console` and `Uri`) are another color. Other syntax elements are also colorized, such as string literals and comments. C++ uses color to differentiate among types, enumerations, and macros, among other tokens.<br><br> You can see the default color for each type, and you can change the color for any specific syntax element in the [Fonts and Colors, Environment, Options dialog box](../ide/reference/fonts-and-colors-environment-options-dialog-box.md), which you can open from the **Tools** menu.|
29
+
|Syntax Coloring|Some syntax elements of code and markup files are colored differently to distinguish them. For example, keywords (such as `using` in C# and `Imports` in Visual Basic) are one color, but types (such as `Console` and `Uri`) are another color. Other syntax elements are also colorized, such as string literals and comments. C++ uses color to differentiate among types, enumerations, and macros, among other tokens.<br><br> You can see the default color for each type, and you can change the color for any specific syntax element in the Fonts and Colors section of the Visual Studio settings pages, which you can open from the **Tools** menu. See [Customize environment options for fonts and colors](fonts-and-colors-environment-options-dialog-box.md).|
30
30
|Error and Warning Marks|As you add code and build your solution, you might see (a) different-colored wavy underlines known as squiggles or (b) light bulbs appearing in your code. Red squiggles denote syntax errors, blue denotes compiler errors, green denotes warnings, and purple denotes other types of errors. [Quick Actions](../ide/quick-actions.md) suggest fixes for problems and make it easy to apply the fix.<br><br> You can see the default color for each error and warning squiggle in the **Tools** > **Options** > **Environment** > **Fonts and Colors** dialog box. Under **Display items**, look for **Syntax Error**, **Compiler Error**, **Warning**, and **Other Error**.|
31
31
|Brace Matching|When the insertion point is placed on an open brace in a code file, both it and the closing brace are highlighted. This feature gives you immediate feedback on misplaced or missing braces. You can turn brace matching on or off with the **Automatic delimiter highlighting** setting (**Tools** > **Options** > **Text Editor**). You can change the highlight color in **Tools** > **Options** > **Environment** > **Fonts and Colors**. Look for **Brace Matching (Highlight)** or **Brace Matching (Rectangle)**.|
32
-
|Auto Surround|With Visual Studio 2022 version 17.9 and later, you can automatically surround a selection with matching delimiters when using double quotes (`""`), single quotes (`''`), brackets (`()`, `{}`, `[]`), or any delimiters supported by the file's language. When you add an opening delimiter (`"`, `'`, `(`) to a selection in your code file, the matching closing delimiter is automatically placed around the selection.<br><br>You can turn auto surround on or off with the **Automatically surround selections when typing quotes or brackets** setting in the **Display** section of the **Tools** > **Options** > **Text Editor** page.|
33
-
|Structure Visualizer|Dotted lines connect matching braces in code files, making it easier to see opening and closing brace pairs. This feature can help you find code in your codebase more quickly. You can turn these lines on or off with the **Show structure guidelines** in the **Display** section of the **Tools** > **Options** > **Text Editor** > **General** page.|
32
+
|Auto Surround|You can automatically surround a selection with matching delimiters when using double quotes (`""`), single quotes (`''`), brackets (`()`, `{}`, `[]`), or any delimiters supported by the file's language. When you add an opening delimiter (`"`, `'`, `(`) to a selection in your code file, the matching closing delimiter is automatically placed around the selection.<br><br>You can turn auto surround on or off with the **Automatically surround selections when typing quotes or brackets** setting in the **Display** section of the **Tools** > **Options** > **Text Editor** page.|
33
+
|Structure Visualizer|Dotted lines connect matching braces in code files, making it easier to see opening and closing brace pairs. This feature can help you find code in your codebase more quickly. You can turn these lines on or off with the **Show structure guide lines** in the **Display** section of the **Tools** > **Options** > **Text Editor** > **General** page.|
34
34
|Line Numbers|Line numbers can be displayed in the left margin of the code window. They aren't displayed by default. You can turn on this option in the **Text Editor All Languages** settings (**Tools** > **Options** > **Text Editor** > **All Languages**). You can display line numbers for individual programming languages by changing the settings for those languages (**Tools** > **Options** > **Text Editor** > **\<language>**). For line numbers to print, you must select **Include line numbers** in the **Print** dialog box.|
35
35
|Change Tracking|The color of the left margin allows you to keep track of the changes you made in a file. Changes you made since the file was opened but not saved are denoted by a yellow bar on the left margin (known as the selection margin). After you save the changes (but before closing the file), the bar turns green. If you undo a change after you save the file, the bar turns orange. To turn this feature off and on, change the **Track changes** option in the **Text Editor** settings (**Tools** > **Options** > **Text Editor**).|
36
36
|Selecting Code and Text|You can select text either in the standard continuous stream mode or in box mode, in which you select a rectangular portion of text instead of a set of lines. To make a selection in box mode, press **Alt** as you drag the mouse over the selection, or press **Alt**+**Shift**+**\<arrow key>**. The selection includes all of the characters within the rectangle defined by the first character and the last character in the selection. Anything typed or pasted into the selected area is inserted at the same point on each line.|
@@ -111,7 +111,7 @@ To define new hotkeys or redefine existing hotkeys, go to **Tools** > **Options*
111
111
112
112
The bottom margin of the editor contains some customization controls.
113
113
114
-
You can easily change the default indentation style from tabs to spaces to vice versa by clicking on SPC or TAB. The actual number of spaces is configurable in **Tools** > **Options**, under **All Settings** > **Text Editor** > **All languages** > **Tabs**.
114
+
You can easily change the default indentation style from tabs to spaces to vice versa by clicking on SPC or TAB. The actual number of spaces is configurable in **Tools** > **Options**, under **All Settings** > **Languages** > **Defaults** > **Tabs**.
115
115
116
116
You can also change the default end-of-line codes from CR LF, the standard on Windows, to a different setting for better compatibility with other operating systems.
0 commit comments