Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

enter image description here

I usually use comma , to set the same variable type like the gif above.

But a problem is when I hit Enter after write second variable, the VS breaks the line automatically.

As a formal Atom user, it's a bit tedious because in Atom it doesn't break the line whatever the indent number is. (My current indent number is 2.)

I changed and tested it all of the options inTools > Options > Text Editor > Basic > Tabs, but none of these turn off the breaking line. Even disabling pretty listening won't work.

How do I turn off this feature?

like image 249
sniffingdoggo Avatar asked Mar 02 '20 04:03

sniffingdoggo


Video Answer


2 Answers

Judging by the glimpse of Intellisense and the fact that Enter auto-formats, it looks like you're editing a JavaScript file.

To disable auto-formatting after hitting Enter, go to Tools > Options > Text Editor > JavaScript/TypeScript > Formatting > General and toggle Format completed line on Enter to unchecked:

enter image description here

like image 176
Mihai Albert Avatar answered Oct 21 '22 01:10

Mihai Albert


The accepted answer doesn't work in Visual Studio 2019 with Visual Basic. These options on the image aren't even shown in the Options for Basic.

However, when the Pretty listing option is turned off, this behavior ceases.

enter image description here

like image 28
Ilya Rabyy Avatar answered Oct 21 '22 00:10

Ilya Rabyy