'How to disable autoindent on enter

I see multiple settings for Code in terms of how to indent (spaces vs tabs), but nothing about how to disable indents. So for example, I enter a <p> tag, hit enter, and Code auto indents the next line. I'd like to disable that but cannot find the setting to do so.



Solution 1:[1]

No, there is no option to disable auto indent on enter. But if you need to insure that inline elements remain without extra spaces because it affects the layout you can use the new option, introduced in v1.0: html.format.unformatted - comma separated list of tags that shouldn't be reformatted. Default value null means that all inline elements should remain as you formatted them.

In addition, instead of typing <p> + Enter you can type just p and press tab which will give you a nice <p><\p> and will place the cursor in the middle.

Hope this helps.

Solution 2:[2]

You can now set the configuration property editor.autoIndent in your settings.json file (which for me was in C:\Users\$USER\AppData\Roaming\Code\User\settings.json). the value you want to set it to is the string "none".

see this thread for more details https://github.com/microsoft/vscode/issues/5446#issuecomment-559145939

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jurijs Kovzels
Solution 2 Dave Ankin