Configure Indent php (4 spaces) vs. phtml (2 spaces) is this possible?

Is is possible (via settings or additional package) to set 2 space indentation for .php files and 4 space indentation for .phtml files?

Thanks in advance!

If you work with EditorConfig files, it’s easy. All you need to do is install the package for Atom and put an .editorconfig in your project root.

Example:

root = true

[*]
indent_style = space

[*.php]
indent_size = 2

[*.phtml]
indent_size = 4

EditorConfig is supported by many editors, either directly or through plugin.

1 Like

Works like a charm! For whatever reason i thought that .editorconfig is core functionality and never searched for that package. :sweat_smile:

Thanks!