I really don't like this style of formatting:
Class AwesomeClass { private static void AwesomeMethod() { } }
Can I make it format my code like this?
Class AwesomeClass { private static void AwesomeMethod() { } }
On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.
The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
Go to Tools > Options > Text Editor > C# > Formatting > New Lines.
In recent version of Visual Studio (at least 2017):
Tools > Options > Text Editor > C# > Code Style > Formatting > New Lines
Then just uncheck every option you see there.
Tools > Options
Check "Show all settings"
Text Editor > C# > Formatting > New Lines
Uncheck the settings for where you want no extra newline added. Personally I always uncheck all items in this category.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With