0

I want to format a document in a special way, instead of auto formatting:

if(...){

}else{

}

VS should format it like this:

if(...)
{

}
else
{

}

So the brackets ({ and }) should be direct under the keywords.

How is that possible?

Cœur
  • 37,241
  • 25
  • 195
  • 267
kkkk00999
  • 179
  • 2
  • 13
  • There's actually a reason why the usual convention in javascript is to keep braces on the same line, http://stackoverflow.com/a/3218860/62829. From personal experience, changing the editor defaults is a bad idea unless you always work alone, you will get in a checkin war with your colleagues, changing the style of code every time you check it in and making it hard to see the actual code changes in a diff – mattmanser Jul 12 '16 at 09:43

1 Answers1

2

You can do this in VS by activating the two checkboxes in Tools > Options... > Text Editor > JavaScript (or whatever formatting you want to customize) > Formatting > New Lines.

enter image description here

diiN__________
  • 7,393
  • 6
  • 42
  • 69