How to change indentation in Visual Studio Code?

前端 未结 14 1572
臣服心动
臣服心动 2020-12-02 03:47

For every typescript file visual studio code uses an auto indentation of 8 spaces. This is a bit too much for my taste but I can\'t find where to change it.

Maybe it

相关标签:
14条回答
  • 2020-12-02 04:52

    I wanted to change the indentation of my existing HTML file from 4 spaces to 2 spaces.

    I clicked the 'Spaces: 4' button in the status bar and changed them to two in the next dialog box.

    I use 'vim' extension. I don't how to re-indent without vim

    To re-indent my current file, I used this:

    gg
    
    =
    
    G
    
    0 讨论(0)
  • 2020-12-02 04:52

    The Problem of auto deintending is caused due to a checkbox being active in the settings of VSCode. Follow these steps:

    1. goto preferences

    2. goto settings

    3. search 'editor:trim auto whitespace'

    4. Uncheck The box

    0 讨论(0)
提交回复
热议问题