Visual Studio 2019: Auto Indent

Randy Price

Apologies for the triviality of this problem - I can't seem to find an answer anywhere.

Suppose I have the following block:

int plus(int x, int y)
{
    int z = x + y;% Cursor is here
}

After pressing return, I want the cursor to land here:

int plus(int x, int y)
{
    int z = x + y;
    % Cursor is here
}

But right now, it's landing here:

int plus(int x, int y)
{
    int z = x + y;
% Cursor is here
}

How can I make the editor auto-indent to the beginning of the previous line?

Minxin Yu - MSFT

You can set Tools -> Options -> Text editor -> C/C++-> Tabs -> Indenting:Smart in Visual Studio.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Default indent line guide in Visual Studio Code?

Indent/format code in Visual Studio code on MAC

Visual Studio indent HTML tag contents

Visual Studio 2017 Indent Guide Coloring

Auto-indent rules for file extension in Visual Studio Code (vscode)?

Visual Studio Code Auto close tag and indent XML as with HTML

Visual Studio 2019 - SSDT

Select code to be ignored by auto indent in Android Studio

(Visual Studio Code) How to indent selection?

Unecessary indent error in visual studio using python

Visual studio 2019 auto removed nuget packages after debug

How to turn off double quotes auto-completion in Visual Studio 2019 for C++ editor?

Activate auto-complete for C# in Visual Studio 2019

Unity3D with Visual Studio 2019 - Auto Refresh

Visual studio 2019 preview - auto complete is not selecting the first or any option

Upgrading xproj in Visual Studio 2019

How to turn off auto indent in Visual Studio 2019? (not VISUAL STUDIO CODE)

Avoid auto indent when saving in Visual Studio Code

Visual Studio 2019 disable auto-building solution on save

Turning off auto-suggestions in Visual Studio 2019 without turning off IntelliSense

Disable suggestions list auto-resize on Visual Studio 2019?

Visual studio auto-indent for variable assignments

Visual Studio Code Indent Configuration & EditorConfig?

Auto increment FileVersion (build nr) in Visual Studio 2019

Mysterious auto-added "using" in C# file(Visual Studio 2019 Community)

Auto import usings not working Visual Studio 2019

ThreadSanitizer in Visual Studio 2019

Indent a Proto file in Visual Studio

Visual studio indent string