See, there are settings for each file type, say, html. I indicated tab indentation 2 there, so that it was even narrower.

But in some files there are indents 4. Ie a very wide code is obtained, and I like to use autoformatting.

Here and how in these files to force to change indents? by 2. Settings have already been changed. But some files are not affected.

    3 answers 3

    You need to reformat the Code | Reformat Code . More details in the official documentation.

    • I speak I use auto format. ctrl alt shift + L But in some he does according to the old indents! 4 indentation. I set up 2. a trifle, but I want to have 2 indents everywhere - Alex Lizenberg
    • @AlexLizenberg, as far as I remember, if you configure, for example, for HTML 2 indentation, and for PHP - 4, then when auto formatting in a PHP file, the IDE will also make 4 indents for markup. - Roman Grinyov
    1. Ctrl + Alt + S (File → Settings)
    2. Editor → Code Style → HTML (your language name)
    3. It is necessary to change the Tab size, Ident, Continuation ident - I put all 2.
    4. If you use spaces, not tabs, you must uncheck Use tab character (I removed).
    5. In the file editing window, press Ctrl + Alt + L (Code → Reformat Code)
      1. If all the same after Ctrl + Alt + L (Code → Reformat Code) puts spaces, try unchecking Enable EditorConfig support (File → Settings → Editor → Code Style)