Indentation
Indentation settings are configured for every programming language separately.
GoLand displays the indentation information in the status bar. So, if your project has files of different types, the easiest way of learning the current indentation style and accessing the corresponding settings is to use the Indentation widget.
![Indentation widget Indentation widget](https://resources.jetbrains.com/help/img/idea/2024.3/indentation-widget.png)
Since indentation is configured separately for each programming language, the number of indentations displayed may vary between opened items. To view the indentation in the status bar, open a file containing the relevant code in the editor.
In GoLand, you can configure indents in code style schemes or in .editorconfig files.
note
To be able to use EditorConfig in your project, the EditorConfig plugin must be enabled.
Click the widget and select Configure Indents for Go.
In the dialog that opens, you can change settings for tabs and indents and also configure other code style settings. Click OK.
Reformat the necessary part of your project to apply new indentation settings.
Files in which code style settings are specified via .editorconfig files have the icon in the widget.
Click the widget and select Open .editorconfig.
The IDE opens the nearest .editorconfig file which affects the file that you're currently working with. To view a list of all available .editorconfig files, click Show Files Related to Project.
Make your changes and reformat the necessary part of your project to apply new indentation settings.
You can configure GoLand to detect the indentation style in the current file and use this style instead of the indents specified in the code style settings for a specific language.
Press CtrlAlt0S to open settings and then select Editor | Code Style.
Select the Detect and use existing file indents for editing checkbox.
Apply the changes and close the dialog.
To disable automatic indentation, go back to settings and deselect the checkbox or click the Indentation widget and select Disable Indents Detection for Project.
Thanks for your feedback!