Skip to content

Commit 4df1f16

Browse files
committed
Merged main into live
2 parents c30c6a3 + 8851e62 commit 4df1f16

10 files changed

+108
-103
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "docs/ide/reference/options-text-editor-all-languages-tabs.md",
5+
"redirect_url": "/visualstudio/ide/options-text-editor-all-languages-tabs",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path": "docs/ide/reference/paste-json-xml.md",
510
"redirect_url": "/visualstudio/ide/paste-json-xml",
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Configure indent and tab settings
3+
description: Learn how to use the Tabs page in the All Languages section to change the default behavior of the code editor tabs within Visual Studio.
4+
ms.date: 08/08/2025
5+
ms.topic: reference
6+
f1_keywords:
7+
- VS.ToolsOptionsPages.Text_Editor.All_Languages.Tabs
8+
- VS.ToolsOptionsPages.Text_Editor.Basic.Tabs
9+
- VS.ToolsOptionsPages.Text_Editor.CSharp.Tabs
10+
- VS.ToolsOptionsPages.Text_Editor.C%2FC%2B%2B.Tabs
11+
- VS.ToolsOptionsPages.Text_Editor.CoffeeScript.Tabs
12+
- VS.ToolsOptionsPages.Text_Editor.CSS.Tabs
13+
- VS.ToolsOptionsPages.Text_Editor.Dockerfile.Tabs
14+
- VS.ToolsOptionsPages.Text_Editor.F%2523.Tabs
15+
- VS.ToolsOptionsPages.Text_Editor.HQL.Tabs
16+
- VS.ToolsOptionsPages.Text_Editor.HTML.Tabs
17+
- VS.ToolsOptionsPages.Text_Editor.HTMLX.Tabs
18+
- VS.ToolsOptionsPages.Text_Editor.JavaScript.Tabs
19+
- VS.ToolsOptionsPages.Text_Editor.TypeScript.Tabs
20+
- VS.ToolsOptionsPages.Text_Editor.JSON.Tabs
21+
- VS.ToolsOptionsPages.Text_Editor.LESS.Tabs
22+
- VS.ToolsOptionsPages.Text_Editor.Plain_Text.Tabs
23+
- VS.ToolsOptionsPages.Text_Editor.ResJSON.Tabs
24+
- VS.ToolsOptionsPages.Text_Editor.SCSS.Tabs
25+
- VS.ToolsOptionsPages.Text_Editor.SQL_Server_Tools.Tabs
26+
- VS.ToolsOptionsPages.Text_Editor.StreamAnalytics.Tabs
27+
- VS.ToolsOptionsPages.Text_Editor.T-SQL90.Tabs
28+
- VS.ToolsOptionsPages.Text_Editor.U-SQL.Tabs
29+
- VS.ToolsOptionsPages.Text_Editor.XAML.Tabs
30+
- VS.ToolsOptionsPages.Text_Editor.XML.Tabs
31+
helpviewer_keywords:
32+
- indents, Code Editor
33+
- Code Editor, default behavior
34+
- tabs, setting in Code Editor
35+
- All Languages Text Editor Options dialog box
36+
- editors, Code Editor
37+
- Code Editor, indenting
38+
- Code Editor, tabs
39+
ms.custom: "ide-ref"
40+
author: anandmeg
41+
ms.author: meghaanand
42+
manager: mijacobs
43+
ms.subservice: general-ide
44+
---
45+
# Configure indent and tab settings in Visual Studio
46+
47+
Learn how to change the default tab and indentation behavior for the Code Editor in Visual Studio using the text editor configuration options.
48+
49+
## Access the All Languages Tabs options
50+
51+
1. Open Visual Studio.
52+
2. On the menu bar, select **Tools** > **Options**.
53+
3. In the Options dialog, expand the **Text Editor** node.
54+
4. Expand **All Languages**, then select **Tabs**.
55+
56+
> [!CAUTION]
57+
> Changes made here apply to all development languages. Resetting options in this dialog will override individual language settings. To configure options for a specific language, select its subfolder under **Text Editor**.
58+
59+
## Resolve conflicting settings
60+
61+
If you select different tab or indent settings for individual languages, Visual Studio displays a warning message:
62+
- "The indentation settings for individual text formats conflict with each other," for differing **Indenting** options.
63+
- "The tab settings for individual text formats conflict with each other," for differing **Tab** options.
64+
65+
For example, if **Smart indenting** is set for Visual Basic and **Block indenting** for Visual C++, you’ll see a reminder about the conflict.
66+
67+
## Configure indenting options
68+
69+
In the **Indenting** section, choose one of the following indenting styles:
70+
71+
- **None**: New lines are not indented; the cursor starts at the first column.
72+
- **Block**: New lines are automatically indented to match the previous line.
73+
- **Smart**: New lines are indented based on code context and IntelliSense conventions. Not available for all languages.
74+
75+
For example, lines between braces `{ }` may be indented an extra tab stop.
76+
77+
## Configure tab options
78+
79+
In the **Tabs** section, choose the following options.
80+
81+
- **Tab size**: Sets the number of spaces per tab stop (default: 4).
82+
- **Indent size**: Sets the number of spaces for each indentation (default: 4). Tabs, spaces, or both are used to fill the size.
83+
- **Insert spaces**: Indent operations insert only space characters.
84+
- **Keep tabs**: Indent operations insert as many tab characters as possible; spaces fill any remainder.
85+
86+
## Troubleshooting
87+
88+
> [!TIP]
89+
> Adaptive formatting may override your custom tab settings. To disable adaptive formatting, go to **Text Editor** > **Advanced** and toggle **Use adaptive formatting**. You can also use an [.editorconfig](../ide/create-portable-custom-editor-options.md) file to manage indent styles.
90+
91+
## Next steps
92+
93+
- [Options, Text Editor, All Languages](../ide/reference/options-text-editor-all-languages.md)
94+
- [General, Environment, Options Dialog Box](../ide/reference/general-environment-options-dialog-box.md)

docs/ide/productivity-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Write code more quickly by using the following features.
7474

7575
- **Change brace formatting with Formatting/New Lines**. Use the **Formatting** options page to set options for formatting code in the code editor, including new lines. For more information on how to use this setting in C#, see [Options dialog box: Text Editor > C# > Code Style > Formatting](../ide/reference/options-text-editor-csharp-formatting.md). For C++, see [Set your C++ coding preferences in Visual Studio](/cpp/ide/how-to-set-preferences). For Python, see [Format Python code](../python/formatting-python-code.md).
7676

77-
- **Change your indentation with Tabs**. Use custom editor settings, tailored to each codebase, to enforce consistent coding styles for multiple developers working on the same project across different editors and IDEs. Ensure your whole team follows the same language conventions, naming conventions, and formatting rules. Since these custom settings are portable and travel with your code, you can enforce coding styles even outside of Visual Studio. For more information, see [Options, Text Editor, All Languages, Tabs](../ide/reference/options-text-editor-all-languages-tabs.md#tabs).
77+
- **Change your indentation with Tabs**. Use custom editor settings, tailored to each codebase, to enforce consistent coding styles for multiple developers working on the same project across different editors and IDEs. Ensure your whole team follows the same language conventions, naming conventions, and formatting rules. Since these custom settings are portable and travel with your code, you can enforce coding styles even outside of Visual Studio. For more information, see [Options, Text Editor, All Languages, Tabs](../ide/options-text-editor-all-languages-tabs.md).
7878

7979
::: moniker range=">=vs-2022"
8080
- [**Try automatic copy and trim indentation**](writing-code-in-the-code-and-text-editor.md#copy-and-paste-code). Copy code from Visual Studio to another program (Outlook, Teams, etc.), without having to manually fix indentation after you paste your code. Available in Visual Studio 2022 [version 17.7](/visualstudio/releases/2022/release-notes) and later.

docs/ide/reference/options-text-editor-advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Select this option to disable the new [multi-caret selection](../finding-and-rep
9292
9393
## Use adaptive formatting
9494

95-
Based on your most recently updated file, Visual Studio recognizes whether you prefer to use tabs or spaces to indent code. The adaptive formatting option is selected by default. When unselected, Visual Studio uses the settings in **Tools** > **Options** > **Text Editor** > **All Languages** > **[Tabs](options-text-editor-all-languages-tabs.md)** instead.
95+
Based on your most recently updated file, Visual Studio recognizes whether you prefer to use tabs or spaces to indent code. The adaptive formatting option is selected by default. When unselected, Visual Studio uses the settings in **Tools** > **Options** > **Text Editor** > **All Languages** > **[Tabs](../options-text-editor-all-languages-tabs.md)** instead.
9696

9797
> [!TIP]
9898
> You can also change how Visual Studio manages your preferred indent style by using an .*editorconfig* file. For more information, see [Create portable, custom editor settings with EditorConfig](../create-portable-custom-editor-options.md).
@@ -134,7 +134,7 @@ Select this option if you prefer to set the maximum latency that Visual Studio a
134134

135135
## Use adaptive formatting
136136

137-
Based on your most recently updated file, Visual Studio recognizes whether you prefer to use tabs or spaces for code indentation. The adaptive formatting option is selected by default. When unselected, Visual Studio uses the settings in **Tools** > **Options** > **Text Editor** > **All Languages** > **[Tabs](options-text-editor-all-languages-tabs.md)** instead.
137+
Based on your most recently updated file, Visual Studio recognizes whether you prefer to use tabs or spaces for code indentation. The adaptive formatting option is selected by default. When unselected, Visual Studio uses the settings in **Tools** > **Options** > **Text Editor** > **All Languages** > **[Tabs](../options-text-editor-all-languages-tabs.md)** instead.
138138

139139
::: moniker-end
140140

docs/ide/reference/options-text-editor-all-languages-tabs.md

Lines changed: 0 additions & 94 deletions
This file was deleted.

docs/ide/reference/options-text-editor-all-languages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ This setting has no effect on Copy or Cut when a line isn't blank. If nothing is
125125
126126
## See also
127127

128-
- [Options, Text Editor, All Languages, Tabs](../../ide/reference/options-text-editor-all-languages-tabs.md)
128+
- [Options, Text Editor, All Languages, Tabs](../../ide/options-text-editor-all-languages-tabs.md)
129129
- [General, Environment, Options Dialog Box](../../ide/reference/general-environment-options-dialog-box.md)
130130
- [Using IntelliSense](../../ide/using-intellisense.md)

docs/ide/reference/options-text-editor-basic-visual-basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ The text editor can suggest solutions to common errors and allow you to select t
140140
## See also
141141

142142
- [General, Environment, Options Dialog Box](../../ide/reference/general-environment-options-dialog-box.md)
143-
- [Options, Text Editor, All Languages, Tabs](../../ide/reference/options-text-editor-all-languages-tabs.md)
143+
- [Options, Text Editor, All Languages, Tabs](../../ide/options-text-editor-all-languages-tabs.md)

docs/ide/reference/options-text-editor-fsharp-advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Select this check box to automatically outline the code file, which creates coll
2626
## See also
2727

2828
- [General, Environment, Options Dialog Box](../../ide/reference/general-environment-options-dialog-box.md)
29-
- [Options, Text Editor, All Languages, Tabs](../../ide/reference/options-text-editor-all-languages-tabs.md)
29+
- [Options, Text Editor, All Languages, Tabs](../../ide/options-text-editor-all-languages-tabs.md)

docs/ide/reference/options-text-editor-general.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Use this control to toggle the editing context settings altogether, or personali
266266
## See also
267267

268268
- [Options, Text Editor, All Languages](../../ide/reference/options-text-editor-all-languages.md)
269-
- [Options, Text Editor, All Languages, Tabs](../../ide/reference/options-text-editor-all-languages-tabs.md)
269+
- [Options, Text Editor, All Languages, Tabs](../../ide/options-text-editor-all-languages-tabs.md)
270270
- [Options, Text Editor, File Extension](/previous-versions/visualstudio/visual-studio-2017/ide/reference/options-text-editor-file-extension)
271271
- [Identifying and Customizing Keyboard Shortcuts](../../ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio.md)
272272
- [Customizing the Editor](../how-to-change-text-case-in-the-editor.md)

docs/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,8 @@
543543
href: ide/reference/how-to-display-line-numbers-in-the-editor.md
544544
- name: Display URLs as links
545545
href: ide/reference/how-to-display-urls-as-links-in-the-editor.md
546+
- name: Change indents and tabs
547+
href: ide/reference/options-text-editor-all-languages-tabs.md
546548
- name: Code style
547549
items:
548550
- name: Code style preferences
@@ -952,8 +954,6 @@
952954
items:
953955
- name: General
954956
href: ide/reference/options-text-editor-all-languages.md
955-
- name: Tabs
956-
href: ide/reference/options-text-editor-all-languages-tabs.md
957957
- name: Visual Basic
958958
items:
959959
- name: Advanced

0 commit comments

Comments
 (0)