MrProgram
MrProgram

Reputation: 5242

Starting at new line when pressing enter in VS

I'm using VS 2015 and when I press enter after a code line when writing javascript I always start the next line at the beginning. I would like it to start at the "proper" place, for e.g.

    function newLine() {
        Starts here..//Works fine
    }
Starts here now..

EDIT: By "Should start here.." I mean one tab in from the braces, not two lines below :)

Upvotes: 8

Views: 8573

Answers (3)

Rajesh Balakrishnan
Rajesh Balakrishnan

Reputation: 11

Tools -> Options -> Text Editor -> Choose your language -> Tabs -> Indenting -> Smart

Finally you must restart the Visual Studio(all instance).

Upvotes: 0

John  Smith
John Smith

Reputation: 171

Tools -> Options -> Text Editor -> -> Tabs -> Indenting To BLOCK.

Upvotes: 12

DivideByZero
DivideByZero

Reputation: 151

VS 2015 suddendly stopped indenting properly for me. I was able to solve this by going to Tools/Options/Text Editor/"language of choice"/Tabs and selecting smart indenting

Upvotes: 4

Related Questions