Search code examples
c#visual-studiounityvs

UnityVS auto format options


I started using UnityVS instead of monodevelop recently. Its working great with one exception: every time I type in

void function(){

and press Enter key, it auto formats to:

void function()
{
    //code
}

when in actuality, i want it to format like:

void function(){
    //code
}

since I am more comfortable with this format. I tried looking for a way so that the editor will auto format to the second option but haven't been successful. Is there a way to do this?


Solution

  • Try going to Tools>Options, then Text Editor>C#>Formatting>New Lines

    Change the "New Line Options" for placing open braces after methods and whatever else you don't want braces on new lines for.