Search code examples
visual-studio-codenewlineenterauto-indent

How to prevent VSCode auto add new line and indent?


When I Write down a HTML tag,like :

···
<div></div>
···

And press Enter between ><, VSCode always auto add new line and indent, then the result is :

···
<div>
    (← here have an indent)
</div>
···

How can I prevent VSCode operations?


Solution

  • When you are in VSC, go to...

    File > Preferences > Settings > Text Editor

    Scroll down until you find:

    Auto Indent and change full to none

    There are some operations about that you maybe want to know.