# .editorconfig

PowerShell Tools for Visual Studio supports `.editorconfig` files. You can include these files in your PowerShell projects to control aspects of the editor based on the file.

More information on [editor config files here](https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022).

## Spaces

To control the number of spaces inserted when pressing tab, you can create a `.editorconfig` file like the following. This will insert 6 spaces per tab.

```editorconfig
# PowerShell files
[*.{ps1,psm1,psd1}]
indent_size = 6
indent_style = space
```

## Tabs

You can choose to insert tabs by setting the `indent_style` to `tab.`

```editorconfig
# PowerShell files
[*.{ps1,psm1,psd1}]
indent_style = tab
```

## Adaptive Formatting

Adaptive formatting may change the format of your document. Disable it to ensure that your `.editorconfig` file is honored.

<figure><img src="https://3667946160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNFE66tpE_51uobNA70%2Fuploads%2F8KHhtS1zRoQnjXUwDtGJ%2Fimage.png?alt=media&#x26;token=96c7903a-fdb1-4fe2-9788-c94f778dd13d" alt=""><figcaption></figcaption></figure>
